Skip to content

Commit 7a7960d

Browse files
stefanJisoftprops
authored andcommitted
Feat/upload (softprops#34)
* feat: warn file invalid when upload * build: update release shell * update emoji * build: compile main.js
1 parent d651ef4 commit 7a7960d

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ function run() {
3838
});
3939
let rel = yield github_1.release(config, new github_1.GitHubReleaser(gh));
4040
if (config.input_files) {
41-
util_1.paths(config.input_files).forEach((path) => __awaiter(this, void 0, void 0, function* () {
41+
const files = util_1.paths(config.input_files);
42+
if (files.length == 0) {
43+
console.warn(`🤔 ${config.input_files} not include valid file.`);
44+
}
45+
files.forEach((path) => __awaiter(this, void 0, void 0, function* () {
4246
yield github_1.upload(gh, rel.upload_url, path);
4347
}));
4448
}

release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ git checkout -b releases/$1 # If this branch already exists, omit the -b flag
1212
rm -rf node_modules
1313
sed -i '/node_modules/d' .gitignore # Bash command that removes node_modules from .gitignore
1414
npm install --production
15-
git add node_modules .gitignore
15+
git add node_modules -f .gitignore
1616
git commit -m node_modules
1717
git push origin releases/$1

src/main.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ async function run() {
3131
});
3232
let rel = await release(config, new GitHubReleaser(gh));
3333
if (config.input_files) {
34-
paths(config.input_files).forEach(async path => {
34+
const files = paths(config.input_files)
35+
if (files.length == 0) {
36+
console.warn(`🤔 ${config.input_files} not include valid file.`)
37+
}
38+
files.forEach(async path => {
3539
await upload(gh, rel.upload_url, path);
3640
});
3741
}

0 commit comments

Comments
 (0)