Skip to content

Commit

Permalink
Revert "fix(amplify-cli-core): use build script for overrides (aws-am…
Browse files Browse the repository at this point in the history
…plify#13858)"

This reverts commit 30c9f0c.
  • Loading branch information
sobolk committed Jan 31, 2025
1 parent 30c9f0c commit 8164928
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,17 @@ export const buildOverrideDir = async (cwd: string, destDirPath: string): Promis
const tsConfigSampleFilePath = path.join(__dirname, '..', '..', 'resources', 'overrides-resource', 'tsconfig.resource.json');
fs.writeFileSync(tsConfigDestFilePath, fs.readFileSync(tsConfigSampleFilePath));

execa.sync(packageManager.executable, [`run`, `build`, `--project`, `${tsConfigDestFilePath}`], {
// get locally installed tsc executable

const localTscExecutablePath = path.join(cwd, 'node_modules', '.bin', 'tsc');

if (!fs.existsSync(localTscExecutablePath)) {
throw new AmplifyError('MissingOverridesInstallationRequirementsError', {
message: 'TypeScript executable not found.',
resolution: 'Please add it as a dev-dependency in the package.json file for this resource.',
});
}
execa.sync(localTscExecutablePath, [`--project`, `${tsConfigDestFilePath}`], {
cwd: tsConfigDir,
stdio: 'pipe',
encoding: 'utf-8',
Expand Down

0 comments on commit 8164928

Please sign in to comment.