generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow running the local scripts outside of the main FTL director…
…y. (#3017) Previously, trying to run `~/Development/ftl/scripts/ftl dev` from a separate project failed with ``` error:controller0: error: No justfile found ``` After this, `scripts/ftl dev` builds the console correctly, though the console UI still does not load correctly, due to ``` http: proxy error: dial tcp [::1]:5173: connect: connection refused ```
- Loading branch information
Showing
2 changed files
with
9 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
ftldir="$(dirname "$(readlink -f "$0")")/.." | ||
export FTL_DIR="$(dirname "$(readlink -f "$0")")/.." | ||
if [ ! "${HERMIT_ENV}" -ef ${FTL_DIR} ]; then | ||
. "${FTL_DIR}/bin/activate-hermit" | ||
fi | ||
|
||
name="$(basename "$0")" | ||
dest="${ftldir}/build/devel" | ||
dest="${FTL_DIR}/build/devel" | ||
src="./cmd/${name}" | ||
if [ "${name}" = "ftl" ]; then | ||
src="./frontend/cli" | ||
fi | ||
mkdir -p "$dest" | ||
(cd "${ftldir}/${src}" && "${ftldir}/bin/go" build -ldflags="-s -w -buildid=" -o "$dest/${name}" .) && exec "$dest/${name}" "$@" | ||
(cd "${FTL_DIR}/${src}" && "${FTL_DIR}/bin/go" build -ldflags="-s -w -buildid=" -o "$dest/${name}" .) && exec "$dest/${name}" "$@" |