-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,29 @@ | ||
import { execSync } from 'child_process'; | ||
import { join, resolve } from 'path'; | ||
import { join } from 'path'; | ||
|
||
import { AZLE_PACKAGE_PATH } from '../src/compiler/utils/global_paths'; | ||
|
||
// TODO remove install and link after https://github.com/demergent-labs/azle/issues/1807 is resolved | ||
export function linkAndInstallPatch(pathRelativeToAzle: string): void { | ||
// TODO remove install and link after https://github.com/demergent-labs/azle/issues/1807 is resolved | ||
const azleDir = resolve(__dirname, '..'); | ||
console.log( | ||
'process.env.AZLE_END_TO_END_TEST_LINK_AZLE', | ||
process.env.AZLE_END_TO_END_TEST_LINK_AZLE | ||
); | ||
|
||
console.log('AZLE_PACKAGE_PATH', AZLE_PACKAGE_PATH); | ||
|
||
execSync(`cd ${join(azleDir, pathRelativeToAzle)} && npm install`); | ||
// TODO do we even need to do this on release? | ||
execSync( | ||
`cd ${join(AZLE_PACKAGE_PATH, pathRelativeToAzle)} && npm install` | ||
); | ||
|
||
if (process.env.AZLE_END_TO_END_TEST_LINK_AZLE !== 'false') { | ||
// TODO remove logs once we are satisfied that the link doesn't happen during release candidate tests | ||
console.log('--------------------------------------------------------'); | ||
console.log("--- We're linking!!! -----------------------------------"); | ||
console.log('--------------------------------------------------------'); | ||
execSync(`cd ${join(azleDir, pathRelativeToAzle)} && npm link azle`); | ||
execSync( | ||
`cd ${join(AZLE_PACKAGE_PATH, pathRelativeToAzle)} && npm link azle` | ||
); | ||
} | ||
} |