* Make install.sh tee instead of echoing twice
Also, fish bit was the only one that didn't print a newline to
$CONF_FILE, now they're all the same.
* Check if fnm is installed before shell setup
Change $CONF_FILE append strings to check whether $INSTALL_DIR exists
before doing any setup. This way whenever a user syncs their shell
config across machines, the machines without fnm installed won't throw
errors.
---------
Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
* Make installation script respect $XDG_DATA_HOME
* Add os check to determine INSTALL_DIR default location
* Minor refactor
* Use `test -n` with double quotes
* Fix space in directory name issue
* Create yellow-otters-develop.md
Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
* Use separate config file for fish config
* Update installation test for new fish config location
* Update README for new fish config location
* Fix misspelling of conf.d in README
Co-authored-by: James Chen-Smith <15643597+jameschensmith@users.noreply.github.com>
Co-authored-by: James Chen-Smith <15643597+jameschensmith@users.noreply.github.com>
Github URLS are different between release/version so check during
download and install using the correct path.
Adding in a check for if the curl command fails to download.
What are your thoughts on parameterizing the install script for local install? I know this seems weird but it means that I don't have to rely on developers having any tools already installed except bash and some way to edit the files. Here is an actual example script setup I would use.
Here is an example local install script `installLocal.sh`
```bash
#!/usr/bin/env bash
DESIRED_NODE_VERSION=v$(cat package.json | grep -Ei "\"node\"" | grep -Eoi "[0-9]+\.[0-9]+\.[0-9]+")
export FNM_DIR="$(pwd)/.fnm"
if [ ! -d "$FNM_DIR" ]; then
curl 'https://raw.githubusercontent.com/Schniz/fnm/master/.ci/install.sh' | INSTALL_DIR=`pwd` bash
fi
set -e
NODE_DIR="$FNM_DIR/node-versions/$DESIRED_NODE_VERSION/installation/bin"
export PATH=$FNM_DIR:$NODE_DIR:$PATH
#TODO: support fish
eval `fnm env --multi`
if [ ! -f "$NODE_DIR/node" ]; then
fnm install $DESIRED_NODE_VERSION
fi
sumOfPackageJson() {
cat package.json | md5sum | cut -d' ' -f1
}
if [ ! -f ".packageRevision" ] || [ "$(cat .packageRevision)" != "$(sumOfPackageJson)" ]; then
sumOfPackageJson > .packageRevision
npm install
fi
```
then in script called `nodew`
```bash
#!/usr/bin/env bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
source ./installLocal.sh
node "$@"
```
and `npmw`
```bash
#!/usr/bin/env bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
source ./installLocal.sh
npm "$@"
```
and for completeness sake I usually go one step further and do an `appw`
```bash
#!/usr/bin/env bash
cd "$( dirname "${BASH_SOURCE[0]}" )"
source ./installLocal.sh
node ./app/index.js "$@"
```