Skip to content

Commit

Permalink
fix: hugo.sh for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
leovalais authored and multun committed May 6, 2024
1 parent ca20245 commit 3a375e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions hugo.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#!/bin/sh

case "$(uname -s)" in
Darwin*) stat_flag=-f;;
*) stat_flag=-c;;
esac

root_dir=$(realpath "$(dirname "$0")")
new_uid=$(stat -c %u "$root_dir")
new_gid=$(stat -c %g "$root_dir")
new_uid=$(stat $stat_flag %u "$root_dir")
new_gid=$(stat $stat_flag %g "$root_dir")

exec docker run --rm -it \
-u "${new_uid}:${new_gid}" \
Expand Down

0 comments on commit 3a375e0

Please sign in to comment.