From 7a7960d4c709213b2a82aef054f1d91ceff3ada1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=AA=E9=98=B3?= <408776303@qq.com> Date: Sun, 29 Dec 2019 06:07:38 +0800 Subject: [PATCH] Feat/upload (#34) * feat: warn file invalid when upload * build: update release shell * update emoji * build: compile main.js --- lib/main.js | 6 +++++- release.sh | 2 +- src/main.ts | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/main.js b/lib/main.js index cac6688..338a359 100644 --- a/lib/main.js +++ b/lib/main.js @@ -38,7 +38,11 @@ function run() { }); let rel = yield github_1.release(config, new github_1.GitHubReleaser(gh)); if (config.input_files) { - util_1.paths(config.input_files).forEach((path) => __awaiter(this, void 0, void 0, function* () { + const files = util_1.paths(config.input_files); + if (files.length == 0) { + console.warn(`🤔 ${config.input_files} not include valid file.`); + } + files.forEach((path) => __awaiter(this, void 0, void 0, function* () { yield github_1.upload(gh, rel.upload_url, path); })); } diff --git a/release.sh b/release.sh index c033766..e4b1fe4 100755 --- a/release.sh +++ b/release.sh @@ -12,6 +12,6 @@ git checkout -b releases/$1 # If this branch already exists, omit the -b flag rm -rf node_modules sed -i '/node_modules/d' .gitignore # Bash command that removes node_modules from .gitignore npm install --production -git add node_modules .gitignore +git add node_modules -f .gitignore git commit -m node_modules git push origin releases/$1 \ No newline at end of file diff --git a/src/main.ts b/src/main.ts index f185d2f..8541a4c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -31,7 +31,11 @@ async function run() { }); let rel = await release(config, new GitHubReleaser(gh)); if (config.input_files) { - paths(config.input_files).forEach(async path => { + const files = paths(config.input_files) + if (files.length == 0) { + console.warn(`🤔 ${config.input_files} not include valid file.`) + } + files.forEach(async path => { await upload(gh, rel.upload_url, path); }); }