From ea91854e6da60f1662a4bda0d62c2496bd80a176 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Fri, 22 Jul 2022 22:01:25 -0700 Subject: [PATCH] test: ensure test assets are writable when copied for use in e2e tests (cherry picked from commit 22a3251099533164d2907ea5b37129cc7a1fcb53) --- tests/legacy-cli/e2e/utils/assets.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/legacy-cli/e2e/utils/assets.ts b/tests/legacy-cli/e2e/utils/assets.ts index 669f5b48364e..6b472d177d62 100644 --- a/tests/legacy-cli/e2e/utils/assets.ts +++ b/tests/legacy-cli/e2e/utils/assets.ts @@ -1,4 +1,5 @@ import { join } from 'path'; +import { chmod } from 'fs/promises'; import glob from 'glob'; import { getGlobalVariable } from './env'; import { relative, resolve } from 'path'; @@ -33,7 +34,9 @@ export function copyAssets(assetName: string, to?: string) { ? resolve(getGlobalVariable('projects-root'), 'test-project', to, filePath) : join(tempRoot, filePath); - return promise.then(() => copyFile(join(root, filePath), toPath)); + return promise + .then(() => copyFile(join(root, filePath), toPath)) + .then(() => chmod(toPath, 0o777)); }, Promise.resolve()); }) .then(() => tempRoot);