Ensure working directory in scripts
So that they can be run standalone and not just through Mise
This commit is contained in:
@@ -0,0 +1,8 @@
|
|||||||
|
ensure_working_directory!() {
|
||||||
|
root_dir="$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
if [[ "$PWD" != "$root_dir" ]]; then
|
||||||
|
echo "Please run the script from the root of the repo: $root_dir"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -4,4 +4,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
iex -S mix phx.server
|
iex -S mix phx.server
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
git co --theirs priv/gettext/default.pot
|
git co --theirs priv/gettext/default.pot
|
||||||
|
|
||||||
git co --theirs priv/gettext/en/LC_MESSAGES/default.po
|
git co --theirs priv/gettext/en/LC_MESSAGES/default.po
|
||||||
|
|||||||
@@ -4,4 +4,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
mix lint
|
mix lint
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
npm outdated --prefix assets
|
npm outdated --prefix assets
|
||||||
|
|
||||||
mix do tailwind.check_version, esbuild.check_version, sqlean.check_version
|
mix do tailwind.check_version, esbuild.check_version, sqlean.check_version
|
||||||
|
|||||||
@@ -4,4 +4,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
mix precommit
|
mix precommit
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
# Add the Fluxon UI hex source repo
|
# Add the Fluxon UI hex source repo
|
||||||
|
|
||||||
mix hex.repo add fluxon https://repo.fluxonui.com \
|
mix hex.repo add fluxon https://repo.fluxonui.com \
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
npm update --prefix assets
|
npm update --prefix assets
|
||||||
|
|
||||||
mix do tailwind.update_version, esbuild.update_version, sqlean.update_version
|
mix do tailwind.update_version, esbuild.update_version, sqlean.update_version
|
||||||
|
|||||||
@@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
current_date=$(date +%s)
|
current_date=$(date +%s)
|
||||||
project_dir=$(git rev-parse --show-toplevel)
|
project_dir=$(git rev-parse --show-toplevel)
|
||||||
data_dir="$project_dir/data"
|
data_dir="$project_dir/data"
|
||||||
|
|||||||
@@ -5,4 +5,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
hurl --test --progress-bar scripts/prod/deploy.hurl
|
hurl --test --progress-bar scripts/prod/deploy.hurl
|
||||||
|
|||||||
@@ -5,4 +5,8 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
source "$(dirname "$0")/../_helpers.sh"
|
||||||
|
|
||||||
|
ensure_working_directory!
|
||||||
|
|
||||||
rm data/music_library_prod*
|
rm data/music_library_prod*
|
||||||
|
|||||||
Reference in New Issue
Block a user