-
-
Save daxgames/9796033525940e580437409e54fd0e90 to your computer and use it in GitHub Desktop.
chefdk + chruby in WSL/bash
This file contains hidden or 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
| umask 022 | |
| export PATH=~/bin:`echo $PATH | sed 's|:/bin:|&/opscode/chefdk/bin:/mnt/c/Users/Sean/AppData/Local/chefdk/gem/ruby/2.4.0/bin:/opscode/chefdk/embedded/bin:|'` |
This file contains hidden or 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
| #!/bin/bash | |
| ln -sfv /mnt/c/opscode /opscode | |
| ln -sfv /opscode/chefdk/embedded /opt/rubies/chefdk | |
| find /opscode/chefdk/ | egrep '/(chefdk|embedded)/bin/[^\./]+$' | xargs sed -i '/^#!C:/s|C:/|/|' | |
| ln -sfv ruby.exe /opscode/chefdk/embedded/bin/ruby | |
| sed -i -e '/$UID/,/fi/s/^[[:space:]]*\(if \|fi\)/#&/' -e 's/puts/print/' /usr/local/share/chruby/chruby.sh | |
| #TODO: still need to idempotently script placing this next command right after the ruby shell-out in the chruby_use function | |
| # not needed unless/until I reinstall chruby | |
| #[[ "$var" =~ /chefdk$ ]] && PATH="${PATH//$RUBY_ROOT\/bin:/}" && eval "$(chef shell-init bash | grep -v '^export PATH=' | sed 's/\r//g')" && return | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment