Skip to content

Commit 4d368b3

Browse files
authored
Revert "fix(amplify-cli-core): use build script for overrides (#13858)" (#14092)
This reverts commit 30c9f0c.
1 parent 30c9f0c commit 4d368b3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/amplify-cli-core/src/overrides-manager/override-skeleton-generator.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,17 @@ export const buildOverrideDir = async (cwd: string, destDirPath: string): Promis
9393
const tsConfigSampleFilePath = path.join(__dirname, '..', '..', 'resources', 'overrides-resource', 'tsconfig.resource.json');
9494
fs.writeFileSync(tsConfigDestFilePath, fs.readFileSync(tsConfigSampleFilePath));
9595

96-
execa.sync(packageManager.executable, [`run`, `build`, `--project`, `${tsConfigDestFilePath}`], {
96+
// get locally installed tsc executable
97+
98+
const localTscExecutablePath = path.join(cwd, 'node_modules', '.bin', 'tsc');
99+
100+
if (!fs.existsSync(localTscExecutablePath)) {
101+
throw new AmplifyError('MissingOverridesInstallationRequirementsError', {
102+
message: 'TypeScript executable not found.',
103+
resolution: 'Please add it as a dev-dependency in the package.json file for this resource.',
104+
});
105+
}
106+
execa.sync(localTscExecutablePath, [`--project`, `${tsConfigDestFilePath}`], {
97107
cwd: tsConfigDir,
98108
stdio: 'pipe',
99109
encoding: 'utf-8',

0 commit comments

Comments
 (0)