-
Notifications
You must be signed in to change notification settings - Fork 5
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
Catch up latest docs: from 5.1 to 5.4 #215
Conversation
aa7d5d3
to
65619d3
Compare
65619d3
to
866c4c8
Compare
\`\`\`diff | ||
${diffblock} | ||
\`\`\` | ||
`, |
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.
`, | |
`, |
}); | ||
|
||
// Create a directory to put the children diff | ||
fs.mkdirSync('scripts/patches'); |
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.
To avoid issues if the dir already exists you can set recursive option:
fs.mkdirSync('scripts/patches'); | |
fs.mkdirSync('scripts/patches', { recursive: true }); |
} | ||
console.log('shelljs: "git push origin -f ref-upstream" executed'); | ||
|
||
if (shell.exec('git switch master').code !== 0) { |
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.
What about a shell/exec function like this and use it everywhere:
function shellexec(command){
if (shell.exec(command).code !== 0) {
throw new Error(`shelljs: "${command}" command failed`);
}
console.log(`shelljs: "${command}" executed`);
}
|
||
if (!issuePostingError) { | ||
// Once the issues are posted, delete patches folder and files | ||
fs.rmSync('scripts/patches', { recursive: true, force: true }); |
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.
Should be better with a main try/catch and then do the rmSync in the finally
=> #220 |
This is an automatic catch up PR to align our non-translated documentation with the latest official documentation.