Skip to content

Commit

Permalink
Feat/upload (#34)
Browse files Browse the repository at this point in the history
* feat: warn file invalid when upload

* build: update release shell

* update emoji

* build: compile main.js
  • Loading branch information
stefanJi authored and softprops committed Dec 28, 2019
1 parent d651ef4 commit 7a7960d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/main.js
Expand Up @@ -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);
}));
}
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Expand Up @@ -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
6 changes: 5 additions & 1 deletion src/main.ts
Expand Up @@ -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);
});
}
Expand Down

0 comments on commit 7a7960d

Please sign in to comment.