Skip to content

Commit

Permalink
chore(bin): Set bin field to main module
Browse files Browse the repository at this point in the history
To make the main module as binary file, I've added the shebang which refers to "/usr/bin/env node" at the first line.
  • Loading branch information
mitsuki31 committed Jun 30, 2024
1 parent 8331b17 commit d2414ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env node

/**
* Main module for **YTMP3** project to download YouTube videos as audio files using CLI.
*
Expand Down Expand Up @@ -55,7 +57,8 @@ function getInput() {
log.info('\x1b[2mNo URL and batch file specified, using default batch file\x1b[0m');
if (!fs.existsSync(DEFAULT_BATCH_FILE)) {
log.error(
`Default batch file named \x1b[93m${DEFAULT_BATCH_FILE}\x1b[0m does not exist`);
`Default batch file named \x1b[93m${
path.basename(DEFAULT_BATCH_FILE)}\x1b[0m does not exist`);
log.error('Aborted');
process.exit(1);
}
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"title": "YTMP3",
"description": "Simple YouTube Audio Downloader",
"main": "index.js",
"bin": {
"ytmp3": "./index.js"
},
"files": [
"index.js",
"lib/*",
Expand Down

0 comments on commit d2414ad

Please sign in to comment.