-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add shebang to command-line script on post install
- Loading branch information
Ivan Vilanculo
committed
Jan 24, 2023
1 parent
d4865cb
commit ce36d82
Showing
7 changed files
with
32 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { existsSync, readFileSync, writeFileSync } = require('fs') | ||
const path = require('path') | ||
|
||
const SHEBANG = '#!/usr/bin/env node' | ||
const binFile = path.resolve(__dirname, '../dist/src/index.js') | ||
|
||
if (existsSync(binFile)) { | ||
const content = readFileSync(binFile, 'utf-8').trim() | ||
if (content.startsWith(SHEBANG)) return | ||
writeFileSync(binFile, `${SHEBANG}\n\n${content}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* eslint-disable @typescript-eslint/no-var-requires */ | ||
const { existsSync, readFileSync, writeFileSync } = require('fs') | ||
const path = require('path') | ||
|
||
const SHEBANG = '#!/usr/bin/env node' | ||
const binFile = path.resolve(__dirname, '../dist/src/pdf-generator-service.js') | ||
|
||
if (existsSync(binFile)) { | ||
const content = readFileSync(binFile, 'utf-8').trim() | ||
if (content.startsWith(SHEBANG)) return | ||
writeFileSync(binFile, `${SHEBANG}\n\n${content}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters