-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[cli]: Use temporary folder for plugin creation to be able to clean up easy #171
Conversation
process.stdout.write(chalk.green(` Cleaning up ${chalk.cyan(id)}`)); | ||
try { | ||
fs.rmdirSync(tempDir, { recursive: true }); | ||
process.stdout.write(chalk.green(MARKER_SUCCESS)); |
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.
i am still not entirely clear on why it sometimes is console.log and sometimes process.stdout.write (and why not process.stderr.write for errors)
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 reason is that it's cumbersome to remove a newline in console.log()
} catch (e) { | ||
process.stdout.write(chalk.red(` ✗\n`)); | ||
process.stdout.write(chalk.red(MARKER_FAILURE)); |
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 markers already have colors applied right? this goes for all of the usages below ...
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.
👍
…into eide/cli-atomic
🚢 |
Create all files and run all commands in a temp folder, and then atomically move it to it's final destination if everything succeeded. If not, remove the temp directory and all the files in it.