Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static printUpdateSuccessful (socketName, updateStatus, deployTimer) {
debug('printUpdateSuccessful', socketName, updateStatus)
const duration = format.dim(deployTimer.getDuration())
const socketNameStr = `${format.cyan(socketName)}`
if (updateStatus.status === 'ok') {
const status = format.grey('socket synced:')
echo(6)(`${status} ${currentTime()} ${socketNameStr} ${duration}`)
} else if (updateStatus.status === 'stopped') {
// const status = format.grey('socket in sync:');
// echo(5)(`${status} ${currentTime()} ${socketNameStr} ${duration}`);
} else if (updateStatus.status === 'error') {
const errDetail = format.red(updateStatus.message.error)
const status = format.red('socket not synced:')
echo(2)(`${status} ${currentTime()} ${socketNameStr} ${duration} ${errDetail}`)
} else {
const status = format.red('socket not synced:')
echo(2)(`${status} ${currentTime()} ${socketNameStr} ${duration}`)
}
}
);
const actionMock = async () => {};
const migration: IMigration = {
version: 1.0,
describe: 'test',
up: actionMock,
down: () => {},
};
await utils.utils.Migrate([migration]);
expect(loggerMock.warn).toBeCalledTimes(0);
expect(loggerMock.log).toBeCalledTimes(1);
expect(loggerMock.log).toBeCalledWith(' '.repeat(8), chalk.grey('test'));
});
}).then(registerUser).then((spin) => {
console.log(chalk.grey('\n Now you can create a music library, where your music is stored'));
console.log(chalk.grey(' If you are migrating from cassette, you might wanna use cassette downloads folder\n'));
return inquirer.prompt([{
type: 'input',
name: 'name',
message: 'Please choose a friendly name',
default: 'My Music'
}, {
type: 'input',
name: 'path',
message: 'Please entrer the absolute path to your music'
}]).then((res) => [res, spin]);
}).then(createAndScanLibrary)
.then(fetchArtworks)
.catch((result) => {
console.log(chalk.red('FAIL'));
if (result.errors) {
console.log('Following errors occured:\n');
result.errors.forEach(formatError);
console.log('');
}
console.log(chalk.grey('Full query:\n', query));
failedTests++;
})
)
message += `\n\n${chalk.bold(`${prefix}Local:`)}${space}${localAddress}`;
}
if (networkAddress) {
message += `\n${chalk.bold('- On Your Network:')} ${networkAddress}`;
}
if (previous) {
message += chalk.red(`\n\nThis port was picked because ${chalk.underline(previous)} is in use.`);
}
if (clipboard) {
try {
await copy(localAddress);
message += `\n\n${chalk.grey('Copied local address to clipboard!')}`;
} catch (err) {
console.error(error(`Cannot copy to clipboard: ${err.message}`));
}
}
console.log(boxen(message, {
padding: 1,
borderColor: 'green',
margin: 1
}));
} else {
const suffix = localAddress ? ` at ${localAddress}` : '';
console.log(info(`Accepting connections${suffix}`));
}
});
};
var built = workers.map(function(name) {
var worker = {
base: currentPath,
name: path.parse(name).name,
path: path.join(workerPath, name),
fullPath: path.join(currentPath, workerPath, name)
};
debug(chalk.green('\tDiscovered: ') + chalk.white(worker.name + chalk.grey(' at ') + worker.path));
return callback(worker);
});
const baseTemplate = commands => {
return `${chalk.bold('usage: bit [--version] [--help] []')}
${chalk.grey(
'bit is a free and open source tool for turning components from existing source-code to a collection of reusable components.'
)}
${chalk.grey('easily share, reuse, maintain and discover code components from any project.')}
${chalk.grey(`bit documentation: https://${BASE_DOCS_DOMAIN}`)}
${commandsTemplate(commands)}
${chalk.grey("please use 'bit --help' for more information and guides on specific commands.")}`;
};
function log(id, msg, err) {
var str = chalk.green('[router]') + ' ' + msg
str += err ? ' [' + err + '] ' : ' '
str += chalk.grey(id)
util.log(str)
}
const logStarted = (js) => {
logger.info('');
logger.info(chalk.green(`Started: ${ NAME }`));
if (VERSION) {
logger.info(chalk.grey(' - version:'), VERSION);
}
logger.info(chalk.grey(' - port: '), PORT);
logger.info(chalk.grey(' - env: '), process.env.NODE_ENV || 'development');
if (js.files.length > 0) {
const seconds = js.elapsed / 1000;
logger.info(chalk.grey(' - js: '), `${ Math.round(seconds * 10) / 10 } second build time`);
js.files.forEach(item => {
logger.info(chalk.grey(` - ${ item.path },`), filesize(item.fileSize));
});
}
logger.info('');
};
module.exports.welcome = function() {
return '\n ' +
'\n ' + chalk.red('.___ ___. .______ ') + chalk.grey('_-----_') +
'\n ' + chalk.red('| \\/ | | _ \\ ') + chalk.grey('| - - |') +
'\n ' + chalk.red('| \\ / | | |_) | ') + chalk.grey('| ω |') +
'\n ' + chalk.red('| |\\/| | | / ') + chalk.grey('| ___ |') +
'\n ' + chalk.red('| | | | | |\\ \\ __ ') + chalk.grey("__'.___.'__") +
'\n ' + chalk.red('|__| |__| | _| `.__\\ (__) ') + chalk.grey('´ >-< `') +
'\n ' + chalk.red('.______ ______ ______ __ _______') +
'\n ' + chalk.red('| _ \\ / __ \\ / __ \\ | | | ____|') +
'\n ' + chalk.red('| |_) | | | | | | | | | | | | |__') +
'\n ' + chalk.red('| ___/ | | | | | | | | | | | __|') +
'\n ' + chalk.red("| | | `--' | | `--' | | `----.| |____") +
'\n ' + chalk.red('| _| \\______/ \\______/ |_______||_______|') + '\n';
}