fix(core): update

This commit is contained in:
Philipp Kunz 2018-12-09 15:53:38 +01:00
parent f26606f757
commit bbedde01b9

View File

@ -42,9 +42,12 @@ const prepare = async () => {
plugins.smartparam.forEachMinimatch(process.env, 'NPMCI_TOKEN_NPM*', npmEnvArg => {
const npmRegistryUrl = npmEnvArg.split('|')[0];
const npmToken = npmEnvArg.split('|')[1];
npmrcFileString = `//${npmRegistryUrl}/:_authToken="${npmToken}"\n`;
npmrcFileString += `//${npmRegistryUrl}/:_authToken="${npmToken}"\n`;
});
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
npmrcFileString += `registry=https://${config.npmRegistryUrl}\n`;
// final check
if (npmrcFileString.length > 0) {
logger.log('info', 'found one or more access tokens');
} else {
@ -52,9 +55,8 @@ const prepare = async () => {
process.exit(1);
}
// lets save it to disk
plugins.smartfile.memory.toFsSync(npmrcFileString, '/root/.npmrc');
logger.log('info', `setting default npm registry to ${config.npmRegistryUrl}`);
await bash(`npm set registry https://${config.npmRegistryUrl}`);
return;
};