Skip to content

server.js: Change working dir to __dirname before starting server#4612

Merged
julienw merged 2 commits into
firefox-devtools:mainfrom
kazarmy:server.js-anywhere
May 9, 2023
Merged

server.js: Change working dir to __dirname before starting server#4612
julienw merged 2 commits into
firefox-devtools:mainfrom
kazarmy:server.js-anywhere

Conversation

@kazarmy

@kazarmy kazarmy commented May 9, 2023

Copy link
Copy Markdown
Contributor

This pr makes server.js change its working directory to __dirname before starting the webpack server, thus allowing server.js to be run from anywhere on the file system and greatly simplifying bin/launch-fp.sh.

Comment thread bin/launch-fp.sh
Comment on lines -19 to -21
yarn start
else
yarn start "$PROFILEPATH"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

yarn start does the switch to root direcotry thing, so probably you didn't need to cd before and after anyway.
But then I believe that relative file paths still wouldn't work without resolving them with realpath first.
Then I believe your change makes sense and is simple enough.
Thanks!

@julienw julienw enabled auto-merge (squash) May 9, 2023 15:17
@julienw julienw merged commit 3b1994b into firefox-devtools:main May 9, 2023
@canova canova mentioned this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants