Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const tagNotExistingMessage = `Git tag 'v${currentVersion}' doesn't exist.`;
if (yes) {
print(error(tagNotExistingMessage));
print(
info(
'Ship.js cannot figure out since which commit you want to release.'
)
);
print(info('Try again with the following option added:'));
print(info(' --commit-from SHA'));
exitProcess(1);
}
print(warning(tagNotExistingMessage));
const commits = silentExec(`git log --pretty=format:"%h%d %s"`, {
dir,
})
.toString()
.split('\n');
const { answer } = await inquirer.prompt([
{
type: 'list',
pageSize: 10,
name: 'answer',
message: 'Since which commit do you want to release?',
choices: commits.map((commit, index) => `${index + 1}) ${commit}`),
},
]);
const [, commit] = answer.split(' ');
revisionRange = `${commit}..HEAD`;
export default function hubConfigured() {
return (
silentExec(
`yes "" | GITHUB_TOKEN=${process.env.GITHUB_TOKEN || ''} hub release`,
{
ignoreError: true,
}
).code === 0
);
}