-
Notifications
You must be signed in to change notification settings - Fork 84
/
productionNpmRCCreator.js
18 lines (17 loc) · 1.08 KB
/
productionNpmRCCreator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Buffer } from 'buffer';
import fs from 'fs';
// eslint-disable-next-line no-undef
const pat = process.env.ADO_TOKEN;
const b64Token = Buffer.from(pat.trim()).toString('base64');
const npmrc = `//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/registry/:username=msazure
//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/registry/:_password="${b64Token}"
//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/registry/:email=npm requires email to be set but doesn't use the value
//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/:username=msazure
//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/:_password="${b64Token}"
//msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/:email=npm requires email to be set but doesn't use the value
registry=https://msazure.pkgs.visualstudio.com/One/_packaging/microsoft-logic-apps/npm/registry
always-auth=true
auto-install-peers=true
resolution-mode=highest
ignore-workspace-root-check=true`;
fs.writeFileSync('.npmrc', npmrc);