fix(core): Updated dependencies and improved npm preparation logic.
This commit is contained in:
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@ship.zone/npmci',
|
||||
version: '4.1.32',
|
||||
version: '4.1.33',
|
||||
description: 'A tool to streamline Node.js and Docker workflows within CI environments, particularly GitLab CI, providing various CI/CD utilities.'
|
||||
}
|
||||
|
@ -52,12 +52,17 @@ export class NpmciNpmManager {
|
||||
* authenticates npm with token from env var
|
||||
*/
|
||||
public async prepare() {
|
||||
logger.log('info', 'running >>npm prepare<<');
|
||||
const config = this.npmciRef.npmciConfig.getConfig();
|
||||
let npmrcFileString: string = '';
|
||||
await plugins.smartobject.forEachMinimatch(
|
||||
process.env,
|
||||
'NPMCI_TOKEN_NPM*',
|
||||
(npmEnvArg: string) => {
|
||||
if (!npmEnvArg) {
|
||||
logger.log('note','found empty token...');
|
||||
return;
|
||||
}
|
||||
const npmRegistryUrl = npmEnvArg.split('|')[0];
|
||||
logger.log('ok', `found token for ${npmRegistryUrl}`);
|
||||
let npmToken = npmEnvArg.split('|')[1];
|
||||
|
@ -48,10 +48,10 @@ export class NpmciConfig {
|
||||
|
||||
public async init() {
|
||||
this.npmciNpmextra = new plugins.npmextra.Npmextra(paths.cwd);
|
||||
this.kvStorage = new plugins.npmextra.KeyValueStore(
|
||||
'userHomeDir',
|
||||
`${this.npmciRef.npmciEnv.repo.user}_${this.npmciRef.npmciEnv.repo.repo}`
|
||||
);
|
||||
this.kvStorage = new plugins.npmextra.KeyValueStore({
|
||||
typeArg: 'userHomeDir',
|
||||
identityArg: `.npmci_${this.npmciRef.npmciEnv.repo.user}_${this.npmciRef.npmciEnv.repo.repo}`,
|
||||
});
|
||||
this.npmciQenv = new plugins.qenv.Qenv(
|
||||
paths.NpmciProjectDir,
|
||||
paths.NpmciProjectNogitDir,
|
||||
|
Reference in New Issue
Block a user