Skip to content

Commit 4e42527

Browse files
authored
Merge pull request #10 from wesreid/feature/gh-oidc-setup-utility
add utility script to deploy the Github OIDC stack in an AWS account
2 parents 9a9f7ac + 9be4840 commit 4e42527

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

scripts/build-binaries.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { build } from 'esbuild';
2-
import { chmod, writeFile } from 'fs/promises';
2+
import { chmod } from 'fs/promises';
33
import { join } from 'path';
44

55
async function buildBinary() {
@@ -17,7 +17,6 @@ async function buildBinary() {
1717
for (const file of files) {
1818
const outFile = join(process.cwd(), file.out);
1919

20-
// First build without banner
2120
await build({
2221
entryPoints: [file.entry],
2322
bundle: true,
@@ -28,13 +27,11 @@ async function buildBinary() {
2827
minify: true,
2928
sourcemap: false,
3029
external: ['aws-cdk-lib', 'aws-cdk-lib/*', 'aws-cdk', 'commander'],
30+
banner: {
31+
js: '#!/usr/bin/env node',
32+
},
3133
});
3234

33-
// Read the output and prepend shebang
34-
const content = await import('fs').then(fs =>
35-
fs.readFileSync(outFile, 'utf8')
36-
);
37-
await writeFile(outFile, `#!/usr/bin/env node\n${content}`);
3835
await chmod(outFile, '755');
3936
}
4037
}

src/bin/cli.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#!/usr/bin/env node
21
import { program } from 'commander';
32
import { join } from 'path';
43

0 commit comments

Comments
 (0)