Skip to content

Commit

Permalink
Let shell scripts be called from any directory (#966)
Browse files Browse the repository at this point in the history
  • Loading branch information
BD103 authored Feb 16, 2024
1 parent 8d6805b commit 187847d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions generate-assets/generate_assets.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

git clone --depth=1 https://github.com/bevyengine/bevy-assets assets

cargo run --release --bin generate -- assets ../content
5 changes: 5 additions & 0 deletions generate-community/generate_community.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

# Download a copy of the Bevy community repository.
# FIXME: Can this be shortened to git clone --depth=1?
git init bevy-community
cd bevy-community
git remote add origin https://github.com/bevyengine/bevy-community
Expand Down
4 changes: 4 additions & 0 deletions generate-errors/generate_errors.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

# Only download the `errors` folder from the main Bevy repository.
git init bevy
cd bevy
git remote add origin https://github.com/bevyengine/bevy
Expand Down
4 changes: 4 additions & 0 deletions generate-wasm-examples/clone_bevy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

# FIXME: Can this be shortened to git clone --depth=1?
git init bevy
cd bevy
git remote add origin https://github.com/bevyengine/bevy
Expand Down
3 changes: 3 additions & 0 deletions generate-wasm-examples/generate_wasm_examples.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

./clone_bevy.sh

# temporary: fetch tools from main branch
Expand Down
4 changes: 4 additions & 0 deletions write-rustdoc-hide-lines/write_rustdoc_hide_lines.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/bin/sh

# Switch to script's directory, letting it be called from any folder.
cd $(dirname $0)

cargo run --release -- ../content/learn/book
cargo run --release -- ../content/learn/quick-start

0 comments on commit 187847d

Please sign in to comment.