diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-26 20:14:14 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-26 20:14:14 +0800 |
commit | e320f343f8d18a301bc1d74dcb2816e3d1e3be6f (patch) | |
tree | 52b58aa0dd2095b1c2b0f5c577fb33351d095aa4 /packages | |
parent | f6cc7d9c3cb9bbfc3ad5c2ba7a5c0495016e082a (diff) | |
download | dexon-0x-contracts-e320f343f8d18a301bc1d74dcb2816e3d1e3be6f.tar.gz dexon-0x-contracts-e320f343f8d18a301bc1d74dcb2816e3d1e3be6f.tar.zst dexon-0x-contracts-e320f343f8d18a301bc1d74dcb2816e3d1e3be6f.zip |
Add support for testing installations post-publish as well
Diffstat (limited to 'packages')
-rw-r--r-- | packages/monorepo-scripts/src/test_installation.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/monorepo-scripts/src/test_installation.ts b/packages/monorepo-scripts/src/test_installation.ts index a9610e5ee..12c0e7603 100644 --- a/packages/monorepo-scripts/src/test_installation.ts +++ b/packages/monorepo-scripts/src/test_installation.ts @@ -9,6 +9,8 @@ import * as rimraf from 'rimraf'; import { utils } from './utils/utils'; (async () => { + const IS_LOCAL_PUBLISH = process.env.IS_LOCAL_PUBLISH === 'true'; + const registry = IS_LOCAL_PUBLISH ? 'http://localhost:4873' : 'https://registry.npmjs.org'; const monorepoRootPath = path.join(__dirname, '../../..'); const packages = utils.getTopologicallySortedPackages(monorepoRootPath); const installablePackages = _.filter( @@ -26,9 +28,9 @@ import { utils } from './utils/utils'; fs.mkdirSync(testDirectory); await execAsync('yarn init --yes', { cwd: testDirectory }); const npmrcFilePath = path.join(testDirectory, '.npmrc'); - fs.writeFileSync(npmrcFilePath, `registry=http://localhost:4873`); + fs.writeFileSync(npmrcFilePath, `registry=${registry}`); utils.log(`Installing ${packageName}@${lastChangelogVersion}`); - await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=http://localhost:4873`, { + await execAsync(`npm install --save ${packageName}@${lastChangelogVersion} --registry=${registry}`, { cwd: testDirectory, }); const indexFilePath = path.join(testDirectory, 'index.ts'); |