Skip to content

Commit

Permalink
Exclude directories
Browse files Browse the repository at this point in the history
Fixes: #1

Thank you to @Kansattica for proposing this in #3. Closes: #3

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Mar 4, 2021
1 parent 2003cf5 commit bd764e6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async function run() {
for(let i = 0; i < assetPaths.length; i++) {
let assetPath = assetPaths[i];
if(assetPath.indexOf("*") > -1) {
const files = glob.sync(assetPath)
for (const file of files) {
const files = glob.sync(assetPath,{ nodir: true })
for (const file of files) {
paths.push(file)
}
}else {
Expand All @@ -47,7 +47,10 @@ async function run() {
const contentLength = filePath => fs.statSync(filePath).size;
const contentType = "binary/octet-stream"
// Setup headers for API call, see Octokit Documentation: https://octokit.github.io/rest.js/#octokit-routes-repos-upload-release-asset for more information
const headers = { 'content-type': contentType, 'content-length': contentLength(asset) };
const headers = {
'content-type': contentType,
'content-length': contentLength(asset)
};

const assetName = path.basename(asset)
console.log(`Uploading ${assetName}`)
Expand Down

0 comments on commit bd764e6

Please sign in to comment.