Browse Source

Finished feature

pull/2840/head
Hugo Persson 2 years ago
parent
commit
552616b834
  1. 1
      README.md
  2. 28
      git-hooks/pre-commit

1
README.md

@ -158,6 +158,7 @@ Ghostfolio is available for various home server systems, including [Runtipi](htt
1. Run `yarn install`
1. Run `docker-compose --env-file ./.env -f docker/docker-compose.dev.yml up -d` to start [PostgreSQL](https://www.postgresql.org) and [Redis](https://redis.io)
1. Run `yarn database:setup` to initialize the database schema
1. Run `git config core.hooksPath ./git-hooks/` to setup git hooks
1. Start the server and the client (see [_Development_](#Development))
1. Open http://localhost:4200/en in your browser
1. Create a new user via _Get Started_ (this first user will get the role `ADMIN`)

28
git-hooks/pre-commit

@ -0,0 +1,28 @@
#!/bin/bash
# Will check if yarn format is run before executing
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
echo "Running yarn format "
# Run the command and loop over its output
FILES_TO_STAGE=""
i=0
while IFS= read -r line; do
# Process each line here
((i++))
if [ $i -le 2 ]; then
continue
fi
if [[ $line == Done* ]]; then
break
fi
FILES_TO_STAGE="$FILES_TO_STAGE $line"
done < <(yarn format )
git add $FILES_TO_STAGE
echo "Files formatted. Committing..."
Loading…
Cancel
Save