Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function commit (sh, inquirer, repoPath, prompter, options, done) {
var cacheDirectory = cacheDir('commitizen');
var cachePath = path.join(cacheDirectory, 'commitizen.json');
ensureDir(cacheDirectory, function (error) {
if (error) {
console.error("Couldn't create commitizen cache directory: ", error);
// TODO: properly handle error?
} else {
if (options.retryLastCommit) {
console.log('Retrying last commit attempt.');
// We want to use the last commit instead of the current commit,
// so lets override some options using the values from cache.
let {
options: retryOptions,
overrideOptions: retryOverrideOptions,
(async () => {
try {
const argv = parser(process.argv.slice(2), yarnYargsOpts);
const cacheDir = cachedir('larix');
const registryUrl = await runYarnAndGetLastLine(['config', 'get', 'registry']);
const projectRoot = path.resolve('.');
await checkNewVersion(registryUrl, cacheDir);
if (argv.v) {
console.log(require('../package.json').version);
} else {
if (argv._.length >= 1 && argv._[0] === 'remove') {
const packageNames = argv._.slice(1);
await removePrefabs({ projectRoot, packageNames, registryUrl, cacheDir });
}
await runYarn(process.argv.slice(2));
if (argv._.length === 0 || (argv._.length >= 1 && ['add', 'install'].indexOf(argv._[0]) >= 0 && !argv.v)) {
await addPrefabs({ projectRoot, registryUrl, cacheDir });
}
export async function write ({ port }) {
const dir = cachedir('open-in-atom')
const filepath = require('path').resolve(dir, 'port')
const data = `${port}\n`
await thenify(mkdirp)(dir)
await thenify(writeFile)(filepath, data, 'utf-8')
return filepath
}