Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only upload files #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only upload files
If a folder ends with `.js`, `.jsx`, or `.js.map`, it will attempt to upload it, throwing an error:

```
Error: EISDIR: illegal operation on a directory, read
Emitted 'error' event on ReadStream instance at:
    at internal/fs/streams.js:202:14
    at FSReqCallback.wrapper [as oncomplete] (fs.js:528:5) {
  errno: -4068,
  code: 'EISDIR',
  syscall: 'read'
}
```
  • Loading branch information
pathurs authored Sep 7, 2020
commit 0a605646869974ada9ba2f6fb48a8eaf4b8a2816
11 changes: 7 additions & 4 deletions src/commands/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ async function gatherFiles(paths) {
return new Promise(resolve => {
glob('**/*.{js,jsx,js.map}', { cwd: realPath }, async (err, files) => {
for (const file of files) {
map.push({
path: join(realPath, file),
name: file,
});
const filePath = join(realPath, file);
if (statSync(filePath).isFile()) {
map.push({
path: filePath,
name: file,
});
}
}

resolve();
Expand Down