-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making sure all node modules bin/ dirs are in PATH (#92)
- Loading branch information
Showing
11 changed files
with
805 additions
and
17 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,20 +1,62 @@ | ||
# vim: ft=bash | ||
|
||
PATH_add bin | ||
PATH_add /opt/homebrew/bin | ||
|
||
export VOLTA_HOME=${HOME}/.volta | ||
PATH_add ${VOLTA_HOME}/bin | ||
|
||
export brew_prefix="$(brew --prefix)" | ||
|
||
pg_pkg="postgresql@$(cat .postgresql-version)" | ||
pg_dir="$(brew --prefix "${pg_pkg}")/bin/" | ||
|
||
[[ -d ${pg_dir} ]] && PATH_add "${pg_dir}" | ||
[[ -d ${pg_dir} ]] && PATH_add "${pg_dir}" | ||
|
||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES | ||
#——————————————————————————————————————————————————————————— | ||
# Add all the node module's bin paths to the $PATH | ||
# Set "export PATH_DEBUG=1" to see what's happening here. | ||
#——————————————————————————————————————————————————————————— | ||
declare -a node_bin_paths | ||
export PATH_DEBUG=1 | ||
|
||
# save old $PATH | ||
previous_path="${PATH}" | ||
|
||
for dir in $(find node_modules -type d -name bin); do | ||
PATH_add "${dir}" | ||
done | ||
|
||
PATH_add bin | ||
PATH_add /opt/homebrew/bin | ||
PATH_add ${VOLTA_HOME}/bin | ||
|
||
# Re-add the old $PATH at the beginning; now we have it duplicated. | ||
PATH_add "${previous_path}" | ||
|
||
# Now we unique all the paths, but preserve the order | ||
unique_path_file="/tmp/paths.tmp" | ||
export root_dir="$(pwd -P)" | ||
|
||
( | ||
set -e | ||
source ${root_dir}/development/shell-lib.sh | ||
# uniq the paths | ||
array.join ':' $(path.dirs.uniq) | ||
) > "${unique_path_file}" | ||
|
||
export NEW_PATH=$(/bin/cat "${unique_path_file}") | ||
|
||
[[ -n ${NEW_PATH} ]] && { | ||
# We need to unset $PATH completely, otherwise direnv takes over. | ||
# This is dangerous! If we ` | ||
unset PATH | ||
export PATH="${NEW_PATH}" | ||
} | ||
rm -f "${unique_path_file}" | ||
|
||
echo -e "\e[1;35mHINT: use bin/print-paths to see the ordering of your \$PATH variable.\e[0;0m" | ||
|
||
#——————————————————————————————————————————————————————————— | ||
# End of PATH modifications | ||
#——————————————————————————————————————————————————————————— | ||
|
||
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES | ||
export V8HOME=$(brew --prefix [email protected]) | ||
|
||
export CFLAGS="-Wno-error=implicit-function-declaration -Wno-error=no-compound-token-split-by-macro" | ||
|
@@ -25,3 +67,6 @@ export RUBY_CPPFLAGS="$CPPFLAGS" | |
export RUBY_CFLAGS="$CFLAGS" | ||
|
||
[[ -f .envrc.local ]] && source .envrc.local | ||
|
||
|
||
|
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,5 +1,4 @@ | ||
web: env RUBY_DEBUG_OPEN=true bin/rails server | ||
js: yarn build --watch | ||
css: yarn watch:css | ||
browser: sleep 10 && open http://localhost:5000/ && while true; do sleep 100; echo .; done | ||
css: yarn watch:css | ||
web: env RUBY_DEBUG_OPEN=true bin/rails server -p 3000 | ||
js: yarn watch:js --verbose | ||
css: yarn watch:css --verbose | ||
browser: sleep 10 && open http://localhost:3000/ && while true; do sleep 100; echo .; done |
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,6 @@ | ||
#!/usr/bin/env bash | ||
# vim: ft=bash | ||
# Prints current paths in the $PATH variable | ||
|
||
source development/shell-lib.sh | ||
path.dirs.by-line |
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ module FnF | |
# rubocop: disable Rails/Output | ||
class Seeds | ||
unless defined?(SITE_ADMIN_PASSWORD) | ||
SITE_ADMIN_PASSWORD = 'fubar' | ||
SITE_ADMIN_PASSWORD = 'fubar!' | ||
SITE_ADMIN_EMAIL = '[email protected]' | ||
DEFAULT_USER_COUNT = 10 | ||
DEFAULT_EVENT_COUNT = 2 | ||
|
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,26 @@ | ||
#!/usr/bin/env bash | ||
# vim: ft=bash | ||
|
||
declare shell_dir | ||
export shell_dir="${root_dir:=$(pwd -P)}/development" | ||
|
||
# shellcheck source=./shell/is-loaded.sh | ||
source "${shell_dir}/shell/is-loaded.sh" | ||
|
||
function unload.helpers() { | ||
unload.file utils | ||
unload.file array | ||
unload.file path | ||
} | ||
|
||
unload.helpers | ||
|
||
# shellcheck source=./shell/utils.sh | ||
source "${shell_dir}/shell/utils.sh" | ||
|
||
# shellcheck source=./shell/array.sh | ||
source "${shell_dir}/shell/array.sh" | ||
|
||
# shellcheck source=./shell/path.sh | ||
source "${shell_dir}/shell/path.sh" | ||
|
Oops, something went wrong.