Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.

Commit f946cbf

Browse files
committed
fix small file no tips error
1 parent f5b4d8e commit f946cbf

6 files changed

Lines changed: 13 additions & 6 deletions

File tree

lib/commands/hosting.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ commander_1.default
5353
const { parent: { configFile }, envId } = options;
5454
const assignEnvId = yield utils_1.getEnvId(envId, configFile);
5555
const isDir = utils_1.isDirectory(filePath);
56+
console.log('文件部署中...');
5657
try {
5758
const onProgress = utils_1.createOnProgressBar(() => {
5859
logger_1.successLog('文件部署成功!');

lib/commands/storage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ commander_1.default
4343
.command('storage:upload <localPath> [cloudPath]')
4444
.option('-e, --envId [envId]', '环境 Id')
4545
.description('上传文件/文件夹')
46-
.action(function (localPath, cloudPath = localPath, options) {
46+
.action(function (localPath, cloudPath = '', options) {
4747
return __awaiter(this, void 0, void 0, function* () {
4848
const { parent: { configFile }, envId } = options;
4949
const assignEnvId = yield utils_1.getEnvId(envId, configFile);

lib/utils/progress-bar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ function createOnProgressBar(onFinished) {
1313
if (+percent === 1) {
1414
if (finished)
1515
return;
16-
bar.tick(total - lastLoaded);
17-
onFinished();
1816
finished = true;
17+
setTimeout(() => {
18+
onFinished();
19+
}, 500);
20+
bar.tick(total - lastLoaded);
1921
return;
2022
}
2123
const tick = loaded - lastLoaded;

src/commands/hosting.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ program
6363
const assignEnvId = await getEnvId(envId, configFile)
6464
const isDir = isDirectory(filePath)
6565

66+
console.log('文件部署中...')
67+
6668
try {
6769
const onProgress = createOnProgressBar(() => {
6870
successLog('文件部署成功!')

src/commands/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ program
4141
.command('storage:upload <localPath> [cloudPath]')
4242
.option('-e, --envId [envId]', '环境 Id')
4343
.description('上传文件/文件夹')
44-
.action(async function(localPath: string, cloudPath: string = localPath, options) {
44+
.action(async function(localPath: string, cloudPath: string = '', options) {
4545
const {
4646
parent: { configFile },
4747
envId

src/utils/progress-bar.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ export function createOnProgressBar(onFinished: Function) {
99
const { total, loaded, percent } = data
1010
if (+percent === 1) {
1111
if (finished) return
12-
bar.tick(total - lastLoaded)
13-
onFinished()
1412
finished = true
13+
setTimeout(() => {
14+
onFinished()
15+
}, 500)
16+
bar.tick(total - lastLoaded)
1517
return
1618
}
1719
const tick = loaded - lastLoaded

0 commit comments

Comments
 (0)