-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
/logs/server.log missing: preventing npm start out of box #29
Comments
Suppose this could work in package.json |
You could, for instance, short circuit the startup script by having a bash script check if the file exists and create it where it doesn't. Then let the bash script finish by calling the npm start script as normal. In your package.json create another script named "setup" maybe like:
Then create a file in the root of your project called setup.sh with the following #!/bin/bash
# Check for directory "logs" in project root
if [ ! -d ./logs ]; then
mkdir ./logs
fi
# Check for file and create if it doesn't exist
if [ ! -e ./logs/server.log ]; then
touch ./logs/server.log
fi
npm run start # or npm run start:dev Then just run In the above example it will create either the directory and the file or just file if it doesn't exist. Either way this will result in starting the app. After that all future startups can use npm start or npm run start:dev directly. |
Any solution should work on Windows as well. Feathersjs has switched to shx instead of using limited things like |
I'll do something on the refresh needed once Feathersjs Auk lands. |
May be no good way around this, as I understand the need to .gitignore /logs but the lack of /logs/server.log is preventing npm start to work out of the box (until that directory and file is created). Is there a way to create the file on npm start if it doesn't exist?
The text was updated successfully, but these errors were encountered: