-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,518 additions
and
654 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,50 @@ | ||
use flake | ||
# Usage: use_flox [...] | ||
# | ||
# Loads the environment variables from a Flox envrionment | ||
# By default, uses the ".flox" directory to load the envrionment from | ||
# You can also specify a remote envrionment as follows | ||
# | ||
# ``` | ||
# use_flox --remote=<owner>/<name> | ||
# ``` | ||
# or | ||
# ``` | ||
# use_flox --trust --remote=<owner>/<name> | ||
# ``` | ||
# | ||
# Where <owner>/<name> is the name of the remote environment on FloxHub | ||
# | ||
# You can also specify another directory to load the environment from | ||
# | ||
# ``` | ||
# use_flox --dir=<path> | ||
# ``` | ||
# | ||
# Where <path> is the path to a directory containing a ".flox" directory | ||
# | ||
# Custom commands aren't supported, since we use the `flox activate` command to dump and load the environment | ||
# | ||
function use_flox() { | ||
if [[ ! -d ".flox" ]]; then | ||
printf "direnv(use_flox): \`.flox\` directory not found\n" >&2 | ||
printf "direnv(use_flox): Did you run \`flox init\` in this directory?\n" >&2 | ||
return 1 | ||
fi | ||
|
||
echo "" | ||
echo "Loading \`floxdocs\` environment ..." | ||
echo "" | ||
|
||
direnv_load flox activate "$@" -- "$direnv" dump | ||
|
||
if [[ $# == 0 ]]; then | ||
watch_dir ".flox/env/" | ||
watch_file ".flox/env.json" | ||
watch_file ".flox/env.lock" | ||
fi | ||
} | ||
|
||
use_flox | ||
|
||
watch_file "pyproject.toml" | ||
watch_file "poetry.lock" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
run/ | ||
cache/ | ||
lib/ | ||
log/ |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "floxdocs", | ||
"version": 1 | ||
} |
Oops, something went wrong.