@ttmg/cli 0.1.0-beta.10 → 0.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/dist/index.js +2 -32
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -1119,36 +1119,6 @@ async function prepareResource() {
|
|
|
1119
1119
|
}
|
|
1120
1120
|
}
|
|
1121
1121
|
|
|
1122
|
-
async function watchChange() {
|
|
1123
|
-
let debounceTimer = null;
|
|
1124
|
-
fs.watch(process.cwd(), (eventType, filename) => {
|
|
1125
|
-
console.log(chalk.yellow('game resource change, restart to upload'));
|
|
1126
|
-
// 清除之前的定时器
|
|
1127
|
-
if (debounceTimer)
|
|
1128
|
-
clearTimeout(debounceTimer);
|
|
1129
|
-
// 重新设置定时器
|
|
1130
|
-
debounceTimer = setTimeout(async () => {
|
|
1131
|
-
wsServer.sendUploadStatus('start');
|
|
1132
|
-
await prepareResource();
|
|
1133
|
-
uploadGame()
|
|
1134
|
-
.then((res) => {
|
|
1135
|
-
if (res.isSuccess) {
|
|
1136
|
-
wsServer.sendUploadStatus('success');
|
|
1137
|
-
}
|
|
1138
|
-
else {
|
|
1139
|
-
wsServer.sendUploadStatus('error', {
|
|
1140
|
-
errMsg: res.errorMsg,
|
|
1141
|
-
});
|
|
1142
|
-
}
|
|
1143
|
-
})
|
|
1144
|
-
.catch(() => {
|
|
1145
|
-
wsServer.sendUploadStatus('error');
|
|
1146
|
-
});
|
|
1147
|
-
debounceTimer = null;
|
|
1148
|
-
}, 500); // 500ms内只执行一次
|
|
1149
|
-
});
|
|
1150
|
-
}
|
|
1151
|
-
|
|
1152
1122
|
async function showSchema() {
|
|
1153
1123
|
const clientKey = getClientKey();
|
|
1154
1124
|
const outputDir = path.join(OUTPUT_DIR, clientKey);
|
|
@@ -1181,10 +1151,10 @@ async function dev() {
|
|
|
1181
1151
|
/**
|
|
1182
1152
|
* 4. 监听游戏资源变化
|
|
1183
1153
|
*/
|
|
1184
|
-
await watchChange();
|
|
1154
|
+
// await watchChange();
|
|
1185
1155
|
}
|
|
1186
1156
|
|
|
1187
|
-
var version = "0.1.0-beta.
|
|
1157
|
+
var version = "0.1.0-beta.11";
|
|
1188
1158
|
var pkg = {
|
|
1189
1159
|
version: version};
|
|
1190
1160
|
|