Skip to content

Commit

Permalink
update dry-run snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgrain committed Jul 18, 2023
1 parent cc000fe commit d2a001d
Show file tree
Hide file tree
Showing 48 changed files with 65,974 additions and 1,752,792 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,9 @@ function forceSdkInstallation() {
installedSdk = {};
}
function installLatestSdk(packageName) {
console.log("Installing latest AWS SDK v3");
console.log(`Installing latest AWS SDK v3: ${packageName}`);
(0, import_child_process.execSync)(
`HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp`
`NPM_CONFIG_UPDATE_NOTIFIER=false HOME=/tmp npm install ${packageName} --omit=dev --no-package-lock --no-save --prefix /tmp`
);
installedSdk = {
...installedSdk,
Expand All @@ -659,14 +659,16 @@ async function loadAwsSdk(packageName, installLatestAwsSdk) {
try {
if (!installedSdk[packageName] && installLatestAwsSdk === "true") {
installLatestSdk(packageName);
awsSdk = await import(`/tmp/node_modules/${packageName}`).catch(async (e) => {
console.log(`Failed to install latest AWS SDK v3: ${e}`);
return import(packageName);
});
try {
awsSdk = require(`/tmp/node_modules/${packageName}`);
} catch (e) {
console.log(`Failed to install latest AWS SDK v3. Falling back to pr-installed version. Error: ${e}`);
return require(packageName);
}
} else if (installedSdk[packageName]) {
awsSdk = await import(`/tmp/node_modules/${packageName}`);
awsSdk = require(`/tmp/node_modules/${packageName}`);
} else {
awsSdk = await import(packageName);
awsSdk = require(packageName);
}
} catch (error) {
throw Error(`Package ${packageName} does not exist.`);
Expand Down
Loading

0 comments on commit d2a001d

Please sign in to comment.