improve build and publish scripts

This commit is contained in:
Denys Vuika 2020-08-25 15:11:03 +01:00
parent 94273678df
commit da67b6fa19
3 changed files with 4 additions and 11 deletions

View File

@ -85,7 +85,9 @@ function changeRegistry(args: PublishArgs, project: string) {
`strict-ssl=false
registry=http://${args.npmRegistry}
//${args.npmRegistry}/:_authToken="${args.tokenRegistry}"`;
try {
fs.mkdirSync(folder, { recursive: true });
fs.writeFileSync(`${folder}/.npmrc`, content);
} catch (e) {
logger.error('Cannot write file', e);

View File

@ -10,15 +10,6 @@ npm i
npm run dist
cd $DIR/../../
if [ -e "./lib/dist/cli" ];
then
rm -rf "./lib/dist/cli" ;
else if [ ! -d "./lib/dist" ];
then
mkdir ./lib/dist
fi
fi
cp -R ./lib/cli/dist lib/dist/cli/
echo "====== Move to node_modules ======"

View File

@ -17,7 +17,7 @@ then
fi
echo "Publishing on npm with tag $TAG_NPM"
npx @alfresco/adf-cli npm-publish --npmRegistry $NPM_REGISTRY_ADDRESS --tokenRegistry $NPM_REGISTRY_TOKEN --tag $TAG_NPM --pathProject "$(pwd)"
npx @alfresco/adf-cli@alpha npm-publish --npmRegistry $NPM_REGISTRY_ADDRESS --tokenRegistry $NPM_REGISTRY_TOKEN --tag $TAG_NPM --pathProject "$(pwd)"
else
echo "PR No need to release in NPM"
fi;