-
Notifications
You must be signed in to change notification settings - Fork 9
Fix for uploading src files / Add .syncanoignore #144
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
Conversation
adamwardecki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see the comments. Also, this file begs for splitting into smaller modules (aka little refactor ;)).
| const fileNameWithPath = file.replace(`${this.getCompiledScriptsFolder()}`, '') | ||
| const remoteFile = this.remote.files ? this.remote.files[fileNameWithPath] : null | ||
|
|
||
| if (remoteFile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would this do the trick?:
if (!remoteFile || (remoteFile && remoteFile.checksum !== md5(fs.readFileSync(file)))) {
archive.file(file, { name: fileNameWithPath })
}
| let ignore = [] | ||
| try { | ||
| ignore = fs.readFileSync(`${this.getCompiledScriptsFolder()}/.syncanoignore`, 'utf8').split('\n') | ||
| } catch (err) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe a debug log could go into the catch clause
| const fileNameWithPath = file.fullPath.replace(`${this.getSrcFolder()}`, '') | ||
| debug(`Adding file to archive: ${fileNameWithPath}`) | ||
| archive.file(file.fullPath, { name: fileNameWithPath }) | ||
| const fileNameWithPath = file.replace(`${this.getCompiledScriptsFolder()}`, '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the getCompiledScriptsFolder is used 3 times in the createZip function.
Fix #128
Adding
.syncanoignoresupport insrcfolder.