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

V8 engine support #739

Merged
merged 8 commits into from
Feb 25, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
build: mkdirp@1.0.0 api change
  • Loading branch information
PopGoesTheWza committed Feb 22, 2020
commit fb263ea13a0ccd338637e01c277cf204af7d626a
19 changes: 10 additions & 9 deletions src/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,16 @@ export async function writeProjectFiles(files: AppsScriptFile[], rootDir = '') {
sortedFiles.forEach((file) => {
const filePath = `${file.name}.${getFileType(file.type, fileExtension)}`;
const truePath = `${rootDir || '.'}/${filePath}`;
mkdirp(path.dirname(truePath), (err) => {
if (err) logError(err, ERROR.FS_DIR_WRITE);
if (!file.source) return; // disallow empty files
fs.writeFile(truePath, file.source, (err) => {
if (err) logError(err, ERROR.FS_FILE_WRITE);
});
// Log only filename if pulling to root (Code.gs vs ./Code.gs)
console.log(`└─ ${rootDir ? truePath : filePath}`);
});
mkdirp(path.dirname(truePath))
.then(() => {
if (!file.source) return; // disallow empty files
fs.writeFile(truePath, file.source, (err) => {
if (err) logError(err, ERROR.FS_FILE_WRITE);
});
// Log only filename if pulling to root (Code.gs vs ./Code.gs)
console.log(`└─ ${rootDir ? truePath : filePath}`);
})
.catch((reason) => logError(reason, ERROR.FS_DIR_WRITE));
});
}

Expand Down