Skip to content

Commit

Permalink
nodejs being nodejs...
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexInABox committed Aug 12, 2024
1 parent a4450ba commit 53eebfb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/bash

npm postinstall
npm run-script postinstall
sleep 5
#npm run-script start == npm start
npm start

6 comments on commit 53eebfb

@RadSton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldnt it be better to run npm install instead of npm run-script postinstall because then postinstall would be called after npm install has finished and packages are automaticlly installed

@AlexInABox
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postinstall cant possibly run before all modules are installed since postinstall starts a script that uses the discord.js package:
import { REST, Routes } from 'discord.js';

the naming for the postinstall command is not really intuitive tbh.

@AlexInABox
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose a npm script namechange from postinstall -> setupCommands

@RadSton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I named the script postinstall because npm runs scipts called post<action> after <action> is finished and the script setupCommands gets run after all packages are installed
image

@AlexInABox
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postinstall doesn't run in environments where the executing user is root. this is the case for docker.

@RadSton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok do what you must

Please sign in to comment.