Compare commits

..
4 Commits
Author SHA1 Message Date
shanmite 3698c81384 doc: 更新说明文档,调整输出信息 2021-07-14 14:35:24 +08:00
shanmite ad7df1aa74 fix: is_imitator为true时不发送评论 2021-07-11 20:43:10 +08:00
shanmite 29f9ff1381 feat: 可修改关键词设置 2021-07-11 17:10:09 +08:00
shanmite 4f7fb6142e feat: 可在设置修改uid和tag 2021-07-10 20:37:02 +08:00
16 changed files with 173 additions and 179 deletions
-2
View File
@@ -1,7 +1,5 @@
node_modules/
dyids/
dist/
lib/dyid*.txt
dyid.zip
env.js
my_config.js
+2 -2
View File
@@ -1,9 +1,9 @@
# Latest Nodejs + Alpine Linux
FROM node:lts-alpine
MAINTAINER [email protected]
MAINTAINER shanmiteko@github.com
LABEL version="0.1" description="自动参与B站动态抽奖"
LABEL version="1.0" description="自动参与B站动态抽奖"
WORKDIR /lottery
+23 -29
View File
@@ -5,15 +5,15 @@
- [获取COOKIE](#获取cookie)
- [本地运行](#本地运行)
- [可执行文件](#可执行文件)
- [Windows](#windows)
- [Linux](#linux)
- [以源码方式运行](#以源码方式运行)
- [Windows](#windows)
- [Linux](#linux)
- [Docker](#docker)
- [防重复转发](#防重复转发)
- [检测中奖](#检测中奖)
- [检测未读信息, 已读未读信息](#检测未读信息-已读未读信息)
- [中奖推送(可选)](#中奖推送可选)
- [设置说明](#设置说明)
- [自定义设置](#自定义设置)
已实现功能:
> 点赞 评论 转发 @好友 带话题 随机动态 检测开奖 清理
@@ -38,7 +38,7 @@ Chrome浏览器:
2. 进入Application找到Cookies栏中的SESSDATA将HttpOnly选项**取消**勾选
(此步骤是为了方便后续采用JS获取Cookies)
(此步骤是为了方便后续采用JS获取Cookies,获取完毕后应再次勾选)
![取消httponly](doc/pic/getCookies.png)
@@ -66,20 +66,25 @@ Chrome浏览器:
↓↓
### 本地运行
具体操作详见[env.example.js](env.example.js)文件内注释
#### 可执行文件
[打开终端](https://cn.bing.com/search?q=%E5%A6%82%E4%BD%95%E5%9C%A8%E5%BD%93%E5%89%8D%E7%9B%AE%E5%BD%95%E6%89%93%E5%BC%80%E7%BB%88%E7%AB%AF)运行内部的可执行文件即可
1. [[下载](https://github.com/shanmiteko/LotteryAutoScript/releases)|[cnpmjs镜像下载](https://github.com.cnpmjs.org/shanmiteko/LotteryAutoScript/releases)|[Fastgit镜像下载](https://hub.fastgit.org/shanmiteko/LotteryAutoScript/releases)]压缩包并解压
```
env.js
lottery.exe
my_config.js
```
2. `env.js`中填入`COOKIE`和推送参数
3. `my_config.js`中自定义设置
4. 在当前目录下打开终端运行可执行文件`lottery`
[下载](https://github.com/shanmiteko/LotteryAutoScript/releases)
#### 以源码方式运行
[cnpmjs镜像下载](https://github.com.cnpmjs.org/shanmiteko/LotteryAutoScript/releases)
<details>
[Fastgit镜像下载](https://hub.fastgit.org/shanmiteko/LotteryAutoScript/releases)
<summary>点击显示详细说明</summary>
#### Windows
如何搭建运行环境
##### Windows
step1: 下载代码到本地
@@ -133,9 +138,11 @@ npm i && npm run clear
> [windows系统定时运行](./doc/win_schedule.md)
#### Linux
##### Linux
[linux系统配置与定时运行](./doc/linux_schedule.md)
</details>
### Docker
1.初始化
@@ -226,19 +233,6 @@ rm -rf lottery/
----------------------------------------
## 设置说明
### 自定义设置
- **默认设置**存放于[config.js](lib/config.js)和[script.js](lib/Script.js)中
- 修改默认设置(非必要)
- 本地运行 => 在项目根目录下新建my_config.js文件将设置填在其中
- 多账号的设置
分别存储于键`"config_1"``"config_2"`...`"config_n"`中, 例如
```json
{
"config_1": {
"model": "00"
},
"config_2": {
"model": "11"
}
}
```
详见[env.example.js](./env.example.js)文件内部注释
详见[my_config.example.js](./my_config.example.js)文件内部注释
+1
View File
@@ -1,5 +1,6 @@
/**
* 使用时请将此文件命名为env.js
* RELEASE内可执行文件包中已有env.js文件
* 注: 请打开扩展名显示
*/
-3
View File
@@ -6,9 +6,6 @@ let GlobalVar = {
set(key, value) {
this.inner[key] = value
},
updateAll(inner) {
this.inner = inner;
}
};
+10 -6
View File
@@ -113,7 +113,7 @@ class Monitor extends Public {
/** 所有抽奖信息 */
let alllotteryinfo = [];
const { model, chatmodel, is_imitator, maxday: _maxday, minfollower, skip_official_verify, only_followed, at_users, blockword, blacklist } = config;
const { key_words, model, chatmodel, is_imitator, maxday: _maxday, minfollower, skip_official_verify, only_followed, at_users, blockword, blacklist } = config;
const maxday = _maxday * 86400
let dyids_set = new Set();
for (const info of protoLotteryInfo) {
@@ -143,16 +143,19 @@ class Monitor extends Public {
const needAt = /(?:@|艾特)[^@|(艾特)]*?好友/.test(description);
const needTopic = (/(?<=[带加上](?:话题|tag))#.*#/i.exec(description) || [])[0];
const isTwoLevelRelay = /\/\/@/.test(description);
const haslottery = /[抽奖]/.test(description);
const hasGuanZhuan = /[转关].*[转关]/.test(description);
/**是否包含关键词 */
const has_key_words = key_words.map(it => new RegExp(it)).every(it => it.test(description))
if (lottery_info_type === 'uid' && is_imitator) {
isLottery = true;
isSendChat = chatmodel[1] === '1' || chatmodel[1] === '1';
} else if (hasOfficialLottery && model[0] === '1') {
({ ts } = await BiliAPI.getLotteryNotice(dyid));
if (ts < 0) { alllotteryinfo = null; break }
isLottery = ts > now_ts_10 && ts < now_ts_10 + maxday;
isSendChat = chatmodel[0] === '1';
} else if (!hasOfficialLottery && model[1] === '1' && haslottery && hasGuanZhuan && !isTwoLevelRelay) {
} else if (!hasOfficialLottery && model[1] === '1' && has_key_words && !isTwoLevelRelay) {
({ ts } = Base.getLotteryNotice(description));
if (official_verify && skip_official_verify) {
isLottery = ts === 0 || (ts > now_ts_10 && ts < now_ts_10 + maxday);
@@ -164,12 +167,13 @@ class Monitor extends Public {
}
isSendChat = chatmodel[1] === '1';
}
if (isLottery) {
/* 判断是否关注过 */
const isFollowed = (new RegExp(uid)).test(self.attentionList);
if (only_followed && !isFollowed) continue;
/* 判断是否转发过 */
const isRelay = await MyStorage.searchDyid(dyid);
const isRelayed = await MyStorage.searchDyid(dyid);
/* 获取黑名单并去重合并 */
const { blacklist: remote_blacklist } = GlobalVar.get("remoteconfig");
const new_blacklist = remote_blacklist ?
@@ -178,7 +182,7 @@ class Monitor extends Public {
if ((new RegExp(dyid + '|' + uid)).test(new_blacklist)) continue;
onelotteryinfo.uid = [] /**初始化待关注列表 */
if (!isFollowed) onelotteryinfo.uid.push(uid);
if (!isRelay) {
if (!isRelayed) {
onelotteryinfo.dyid = dyid;
let RandomStr = Base.getRandomOne(config.relay);
let new_ctrl = [];
+44 -26
View File
@@ -86,13 +86,12 @@ class Public {
*/
modifyDynamicRes(res) {
const strToJson = Base.strToJson,
jsonRes = strToJson(res),
{ data } = jsonRes;
if (jsonRes.code !== 0) {
Base.tooltip.warn('获取动态数据出错,可能是访问太频繁');
{ data, code } = strToJson(res);
if (code !== 0) {
Base.tooltip.warn('获取动态数据出错,可能是访问太频繁 \n' + res);
return null;
}
/* 字符串防止损失精度 */
/* 字符串offset防止损失精度 */
const offset = typeof data.offset === 'string' ? data.offset : /(?<=next_offset":)[0-9]*/.exec(res)[0]
, next = {
has_more: data.has_more,
@@ -108,7 +107,7 @@ class Public {
/**
* 空动态无cards
*/
const Cards = data.cards;
const Cards = data.cards || [];
Cards.forEach(onecard => {
/**临时储存单个动态中的信息 */
let obj = {};
@@ -116,38 +115,56 @@ class Public {
, { info, card: user_profile_card } = desc.user_profile
, { official_verify } = user_profile_card
, cardToJson = strToJson(card);
obj.uid = info.uid; /* 转发者的UID */
obj.uname = info.uname;/* 转发者的name */
obj.official_verify = official_verify.type > -1 ? true : false; /* 是否官方号 */
obj.createtime = desc.timestamp /* 动态的ts10 */
obj.type = desc.type /* 动态类型 */
obj.rid_str = desc.rid_str.length > 12 ? desc.dynamic_id_str : desc.rid_str;/* 用于发送评论 */
obj.orig_type = desc.orig_type /* 动态类型 */
obj.dynamic_id = desc.dynamic_id_str; /* 转发者的动态ID !!!!此为大数需使用字符串值,不然JSON.parse()会有丢失精度 */
/* 转发者的UID */
obj.uid = info.uid;
/* 转发者的name */
obj.uname = info.uname;
/* 是否官方号 */
obj.official_verify = official_verify.type > -1 ? true : false;
/* 动态的ts10 */
obj.createtime = desc.timestamp
/* 动态类型 */
obj.type = desc.type
/* 用于发送评论 */
obj.rid_str = desc.rid_str.length > 12 ? desc.dynamic_id_str : desc.rid_str;
/* 源动态类型 */
obj.orig_type = desc.orig_type
/* 转发者的动态ID !!!!此为大数需使用字符串值,不然JSON.parse()会有丢失精度 */
obj.dynamic_id = desc.dynamic_id_str;
const { extension, extend_json } = onecard;
obj.ctrl = (typeof extend_json === 'undefined') ? [] : strToJson(extend_json).ctrl || []; /* 定位@信息 */
obj.hasOfficialLottery = (typeof extension === 'undefined') ? false : typeof extension.lott === 'undefined' ? false : true; /* 是否有官方抽奖 */
/* 定位@信息 */
obj.ctrl = (typeof extend_json === 'undefined') ? [] : strToJson(extend_json).ctrl || [];
/* 是否有官方抽奖 */
obj.hasOfficialLottery = (typeof extension === 'undefined') ? false : typeof extension.lott === 'undefined' ? false : true;
const item = cardToJson.item || {};
obj.description = item.content || item.description || ''; /* 转发者的描述 */
/* 转发者的描述 */
obj.description = item.content || item.description || '';
if (obj.type === 1) {
obj.origin_uid = desc.origin.uid; /* 被转发者的UID */
obj.origin_rid_str = desc.origin.rid_str.length > 12 ? desc.origin.dynamic_id_str : desc.origin.rid_str; /* 被转发者的rid(用于发评论) */
obj.origin_dynamic_id = desc.orig_dy_id_str; /* 被转发者的动态的ID !!!!此为大数需使用字符串值,不然JSON.parse()会有丢失精度 */
/* 被转发者的UID */
obj.origin_uid = desc.origin.uid;
/* 被转发者的rid(用于发评论) */
obj.origin_rid_str = desc.origin.rid_str.length > 12 ? desc.origin.dynamic_id_str : desc.origin.rid_str;
/* 被转发者的动态的ID !!!!此为大数需使用字符串值,不然JSON.parse()会有丢失精度 */
obj.origin_dynamic_id = desc.orig_dy_id_str;
const { origin_extension, origin_user } = cardToJson;
try {
/* 是否官方号 */
obj.origin_official_verify = typeof origin_user === 'undefined' ?
false : origin_user.card.official_verify.type < 0 ?
false : true; /* 是否官方号 */
} catch (error) {
false : true;
} catch (_) {
obj.origin_official_verify = false;
}
/* 是否有官方抽奖 */
obj.origin_hasOfficialLottery = typeof origin_extension === 'undefined' ?
false : typeof origin_extension.lott === 'undefined' ?
false : true; /* 是否有官方抽奖 */
false : true;
const origin = cardToJson.origin || '{}';
const { user, item } = strToJson(origin);
obj.origin_uname = typeof user === 'undefined' ? '' : user.name || user.uname || ''; /* 被转发者的name */
obj.origin_description = typeof item === 'undefined' ? '' : item.content || item.description || ''; /* 被转发者的描述 */
/* 被转发者的name */
obj.origin_uname = typeof user === 'undefined' ? '' : user.name || user.uname || '';
/* 被转发者的描述 */
obj.origin_description = typeof item === 'undefined' ? '' : item.content || item.description || '';
}
array.push(obj);
});
@@ -245,4 +262,5 @@ class Public {
}
}
module.exports = Public;
module.exports = Public;
-52
View File
@@ -1,52 +0,0 @@
const { config_file, tooltip } = require('./Base');
const default_script = {
author: '@shanmite',
UIDs: [
31252386,
35719643,
689277291
],
TAGs: [
'互动抽奖',
'抽奖',
'转发抽奖',
'动态抽奖',
]
};
/**
* 自己修改过的设置
*/
const my_config = (() => {
let _my_config = {}
if (process.env.LOCALLAUNCH) {
try {
const { UIDs, TAGs } = require(config_file);
if (UIDs) _my_config.UIDs = UIDs;
if (TAGs) _my_config.TAGs = TAGs;
} catch (e) {
tooltip.log("[script]无自定义设置\n" + e);
}
} else {
try {
const { MY_CONFIG } = process.env;
if (MY_CONFIG) {
const { UIDs, TAGs } = JSON.parse(MY_CONFIG);
if (UIDs) _my_config.UIDs = UIDs;
if (TAGs) _my_config.TAGs = TAGs;
}
} catch (_) {
tooltip.log("[script]MY_CONFIG语法错误");
}
}
return _my_config;
})();
const script = {
...default_script,
...my_config
}
module.exports = script;
-1
View File
@@ -34,7 +34,6 @@ async function getFollowList() {
* 清理动态和关注
*/
async function clear() {
config.updata(process.env.NUMBER);
const { clear_max_day, clear_remove_dynamic, clear_remove_attention, clear_remove_delay, clear_dynamic_type } = config;
if (!process.env.LOCALLAUNCH) {
setTimeout(() => {
+5 -3
View File
@@ -16,9 +16,11 @@ const config = {
* @param {string} n
*/
updata(n) {
const new_config = my_config[`config_${n}`] || {};
Object.entries(new_config)
.forEach(([k, v]) => this[k] = v)
const new_config = my_config[`config_${n}`];
if (new_config) {
Object.entries(new_config)
.forEach(([k, v]) => this[k] = v)
}
}
};
-2
View File
@@ -33,7 +33,6 @@ async function createRandomDynamic(num) {
*/
function start() {
return new Promise(resolve => {
config.updata(process.env.NUMBER);
let times = Base.counter();
/* 注册事件 */
eventBus.on('Turn_on_the_Monitor', async () => {
@@ -82,7 +81,6 @@ function start() {
* 是否中奖
*/
async function isMe() {
config.updata(process.env.NUMBER);
let desp = '';
const UnreadAtNum = await BiliAPI.getUnreadAtNum();
const UnreadSessionNum = await BiliAPI.getUnreadSessionNum();
+11 -22
View File
@@ -1,21 +1,10 @@
const Base = require("./Base");
const GlobalVar = require("./GlobalVar");
const MyStorage = require("./MyStorage");
const Script = require("./Script");
const config = require("./config");
const key_map = new Map([['DedeUserID', 'myUID'], ['bili_jct', 'csrf']]);
let __GlobalVar = {
cookie: '',
/**自己的UID*/
myUID: '',
/**防跨站请求伪造*/
csrf: '',
/**
* 抽奖信息
* @type {(string|number)[]}
*/
Lottery: [...Script.UIDs, ...Script.TAGs],
remoteconfig: {},
}
/**
* 生成全局变量文件
* @param {string} cookie
@@ -23,16 +12,16 @@ let __GlobalVar = {
*/
async function setVariable(cookie, n) {
if (cookie) {
const key = ['DedeUserID', 'bili_jct']
__GlobalVar.cookie = cookie;
config.updata(process.env.NUMBER);
GlobalVar.set('cookie', cookie);
cookie.split(/\s*;\s*/).forEach(item => {
const _item = item.split('=');
if (key.indexOf(_item[0]) !== -1) __GlobalVar[_item[0]] = _item[1];
})
__GlobalVar.csrf = __GlobalVar.bili_jct;
__GlobalVar.myUID = __GlobalVar.DedeUserID;
__GlobalVar.remoteconfig = await Base.getRemoteConfig();
GlobalVar.updateAll(__GlobalVar);
if (key_map.has(_item[0]))
GlobalVar.set(key_map.get(_item[0]), _item[1]);
});
GlobalVar.set('Lottery', [...config.UIDs, ...config.TAGs]);
GlobalVar.set('remoteconfig', await Base.getRemoteConfig());
}
await Base.createDir('dyids');
if (process.env.PAT) {
+11 -2
View File
@@ -39,6 +39,7 @@ async function main() {
if (await checkCookie(NUMBER)) {
const mode = process.env.lottery_mode;
const help_msg = "用法: lottery [OPTIONS]\n\nOPTIONS:\n\tstart 启动抽奖\n\tcheck 中奖检查\n\tclear 清理动态和关注\n";
switch (mode) {
case 'start':
tooltip.log('开始参与抽奖');
@@ -55,9 +56,16 @@ async function main() {
tooltip.log('清理动态完毕');
}
break;
case 'help':
console.log(help_msg);
break;
case undefined:
console.log(`错误: 未提供以下参数\n\t[OPTIONS]\n`);
console.log(help_msg);
break
default:
console.log(`Usage: lottery-in-bili [OPTIONS]`)
console.log(`错误OPTIONS: ${mode} 正确OPTIONS: start,check,clear`);
console.log(`错误: 提供了错误的[OPTIONS] -> ${mode}\n`)
console.log(help_msg);
}
}
} else {
@@ -85,6 +93,7 @@ async function main() {
/**OPTIONS */
process.env.lottery_mode = process.argv[2]
await main();
tooltip.log('5秒后自动退出');
await delay(5 * 1000);
process.exit(0)
})()
+29 -2
View File
@@ -3,6 +3,34 @@ module.exports = {
* 默认设置(公用)
*/
default_config: {
/**
* 监视更转的用户uid
*/
UIDs: [
31252386,
35719643,
689277291
],
/**
* 监视的tag
*/
TAGs: [
'互动抽奖',
'抽奖',
'转发抽奖',
'动态抽奖',
],
/**
* 动态中的关键词(表示须同时满足以下条件)
* 符合js正则表达式的字符串
*/
key_words: [
"[抽奖]",
"[转关].*[转关]"
],
/**
* - '00' 关闭自动抽奖
* - '10' 只转发官方抽奖
@@ -179,5 +207,4 @@ module.exports = {
config_1: {},
config_2: {},
config_3: {}
}
}
+19 -9
View File
@@ -7,10 +7,17 @@ DYID_FOLDER=dyids
# 设置环境变量文件
ENV_FILE=env.js
# 自定义设置文件
CONFIG_FILE=my_config.json
CONFIG_FILE=my_config.js
# docker仓库
DOCKER_REPO=shanmite/lottery_auto_docker
# cdn
CDN=https://cdn.staticaly.com/gh/shanmiteko/LotteryAutoScript/main
# env.example.js文件
ENV_EXAMPLE="$CDN/env.example.js"
# my_config.example.js文件
CONFIG_EXAMPLE="$CDN/my_config.example.js"
# 新建脚本目录
if [ ! -d "$SCRIPT_FOLDER" ]; then
echo "create $SCRIPT_FOLDER"
mkdir $SCRIPT_FOLDER
@@ -18,6 +25,7 @@ fi
cd $SCRIPT_FOLDER/
# 新建dyid储存目录
if [ ! -d "$DYID_FOLDER" ]; then
echo "create $DYID_FOLDER/"
mkdir $DYID_FOLDER
@@ -25,16 +33,18 @@ else
echo "$DYID_FOLDER/ exists"
fi
# 新建环境变量设置文件
if [ ! -f "$ENV_FILE" ]; then
echo "create $ENV_FILE"
curl -fsSL https://cdn.staticaly.com/gh/shanmite/LotteryAutoScript/main/env.example.js -o $ENV_FILE
curl -fsSL $ENV_EXAMPLE -o $ENV_FILE
else
echo "$ENV_FILE exists"
fi
# 新建配置文件
if [ ! -f "$CONFIG_FILE" ]; then
echo "create $CONFIG_FILE"
echo "{}" > $CONFIG_FILE
curl -fsSL $CONFIG_EXAMPLE -o $CONFIG_FILE
else
echo "$CONFIG_FILE exists"
fi
@@ -45,8 +55,8 @@ docker -v && docker pull $DOCKER_REPO
echo "create start.sh"
echo -e "#!/bin/bash\n\
docker run \
-v $PWD/env.js:/lottery/env.js \
-v $PWD/my_config.json:/lottery/my_config.json \
-v $PWD/$ENV_FILE:/lottery/$ENV_FILE \
-v $PWD/$CONFIG_FILE:/lottery/$CONFIG_FILE \
-v $PWD/$DYID_FOLDER/:/lottery/$DYID_FOLDER/ \
$DOCKER_REPO \
start" \
@@ -56,8 +66,8 @@ chmod 777 start.sh
echo "create check.sh"
echo -e "#!/bin/bash\n\
docker run \
-v $PWD/env.js:/lottery/env.js \
-v $PWD/my_config.json:/lottery/my_config.json \
-v $PWD/$ENV_FILE:/lottery/$ENV_FILE \
-v $PWD/$CONFIG_FILE:/lottery/$CONFIG_FILE \
-v $PWD/$DYID_FOLDER/:/lottery/$DYID_FOLDER/ \
$DOCKER_REPO \
check" \
@@ -67,8 +77,8 @@ chmod 777 check.sh
echo "create clear.sh"
echo -e "#!/bin/bash\n\
docker run \
-v $PWD/env.js:/lottery/env.js \
-v $PWD/my_config.json:/lottery/my_config.json \
-v $PWD/$ENV_FILE:/lottery/$ENV_FILE \
-v $PWD/$CONFIG_FILE:/lottery/$CONFIG_FILE \
-v $PWD/$DYID_FOLDER/:/lottery/$DYID_FOLDER/ \
$DOCKER_REPO \
clear" \
+18 -18
View File
@@ -6,33 +6,33 @@ $ENV_FILE = "env.js"
$TARGET_DIR = ".\dist"
$WIN_BIN = "lottery-in-bili-win.exe"
$LINUX_BIN = "lottery-in-bili-linux"
$MACOS_BIN = "lottery-in-bili-macos"
$WIN_X64 = "nlts-win-x64"
$LINUX_X64 = "nlts-linux-x64"
$MACOS_X64 = "nlts-macos-x64"
$MAP = @{ $WIN_X64 = $WIN_BIN; $LINUX_X64 = $LINUX_BIN; $MACOS_X64 = $MACOS_BIN}
$TRIARR = @(
@("lottery-in-bili-win.exe", "lottery.exe", "nlts-win-x64"),
@("lottery-in-bili-linux", "lottery", "nlts-linux-x64"),
@("lottery-in-bili-macos", "lottery", "nlts-macos-x64")
)
Copy-Item -Path $TEMPLATE_ENV_FILE -Destination $TARGET_DIR -Force
Copy-Item -Path $TEMPLATE_CONFIG_FILE -Destination $TARGET_DIR -Force
Set-Location -Path $TARGET_DIR
# 重命名文件
Move-Item -Path $TEMPLATE_ENV_FILE -Destination $ENV_FILE -Force
Move-Item -Path $TEMPLATE_CONFIG_FILE -Destination $CONFIG_FILE -Force
foreach($X64 in $MAP.Keys) {
$BIN = $MAP[$X64]
if (!(Test-Path $X64 -PathType Container)) {
New-Item -ItemType Directory -Force -Path $X64
}
Move-Item -Path $BIN -Destination $X64 -Force
Copy-Item -Path $ENV_FILE -Destination $X64 -Force
Copy-Item -Path $CONFIG_FILE -Destination $X64 -Force
Compress-Archive -Path $X64 -DestinationPath $X64 -Force
foreach ($TRI in $TRIARR) {
$PROTO_BIN,$BIN,$DIR = $TRI
New-Item -ItemType Directory -Force -Path $DIR
Move-Item -Path $PROTO_BIN -Destination $BIN -Force
Move-Item -Path $BIN -Destination $DIR -Force
Copy-Item -Path $ENV_FILE -Destination $DIR -Force
Copy-Item -Path $CONFIG_FILE -Destination $DIR -Force
Compress-Archive -Path $DIR -DestinationPath "$($DIR)-$(Get-Date -Format "yyyyMMd")" -Force
}
Remove-Item -Path $ENV_FILE