Browse Source
			
			
			
			
				
		* Use variants instead of a boolean * Add infrastructure for multishell and aliases: Aliases are required because I want to have a default node version on startup * create alias command * fmt * Added aliases (Fixes #29) and opt-in multishell support (Fixes #19) * Better docs * update snapshot * Some/Fail => Some/None * add lint-staged * use refmt and all of prettier are grouped * System.readdir => Fs.readdir (now uses Lwt) * use lstat for file_exists: check if symlink exists instead of actual linked file. also, initialize the Random seed on Env * Remove fish set options that were added in trial and error * Bootstrap script * add bootstrap documentationremotes/origin/add-simple-redirecting-site
				 23 changed files with 4226 additions and 394 deletions
			
			
		@ -0,0 +1,11 @@ | 
				
			|||||||
 | 
					#!/bin/bash | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					GIT_ROOT=$(git rev-parse --show-toplevel) | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$GIT_ROOT" == "" ]; then | 
				
			||||||
 | 
					  echo "Git root cannot be empty" | 
				
			||||||
 | 
					  exit 1 | 
				
			||||||
 | 
					fi | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -f $GIT_ROOT/.git/hooks/pre-commit &> /dev/null | 
				
			||||||
 | 
					ln -s $GIT_ROOT/.ci/pre-commit-hook $GIT_ROOT/.git/hooks/pre-commit | 
				
			||||||
@ -0,0 +1,30 @@ | 
				
			|||||||
 | 
					open Fnm; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					let run = (~name, ~version) => { | 
				
			||||||
 | 
					  let version = Versions.format(version); | 
				
			||||||
 | 
					  let versionPath = Filename.concat(Directories.nodeVersions, version); | 
				
			||||||
 | 
					  let%lwt versionInstalled = Lwt_unix.file_exists(versionPath); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if (!versionInstalled) { | 
				
			||||||
 | 
					    Console.error( | 
				
			||||||
 | 
					      <Pastel color=Pastel.Red> | 
				
			||||||
 | 
					        "Can't find a version installed in " | 
				
			||||||
 | 
					        versionPath | 
				
			||||||
 | 
					      </Pastel>, | 
				
			||||||
 | 
					    ); | 
				
			||||||
 | 
					    exit(1); | 
				
			||||||
 | 
					  }; | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Console.log( | 
				
			||||||
 | 
					    <Pastel> | 
				
			||||||
 | 
					      "Aliasing " | 
				
			||||||
 | 
					      <Pastel color=Pastel.Cyan> name </Pastel> | 
				
			||||||
 | 
					      " to " | 
				
			||||||
 | 
					      <Pastel color=Pastel.Cyan> version </Pastel> | 
				
			||||||
 | 
					    </Pastel>, | 
				
			||||||
 | 
					  ); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let%lwt () = Versions.Aliases.set(~alias=name, ~versionPath); | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Lwt.return(); | 
				
			||||||
 | 
					}; | 
				
			||||||
@ -0,0 +1,31 @@ | 
				
			|||||||
 | 
					#!/bin/bash | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -e | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					eval $(fnm env) | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fnm install v8.11.3 | 
				
			||||||
 | 
					fnm install v11.9.0 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fnm use v8.11.3 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bash -c ' | 
				
			||||||
 | 
					  set -e | 
				
			||||||
 | 
					  eval $(fnm env --multi) | 
				
			||||||
 | 
					  fnm use v11.9.0 | 
				
			||||||
 | 
					  echo "> verifying version v11.9.0 for child bash" | 
				
			||||||
 | 
					  if [ "$(node -v)" == "v11.9.0" ]; then | 
				
			||||||
 | 
					    echo "Okay!" | 
				
			||||||
 | 
					  else | 
				
			||||||
 | 
					    echo "Node version should be v11.9.0 in the bash fork" | 
				
			||||||
 | 
					    exit 1 | 
				
			||||||
 | 
					  fi | 
				
			||||||
 | 
					' | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "> verifying version v8.11.3 for parent bash" | 
				
			||||||
 | 
					if [ "$(node -v)" == "v8.11.3" ]; then | 
				
			||||||
 | 
					  echo "Okay!" | 
				
			||||||
 | 
					else | 
				
			||||||
 | 
					  echo "Node version should be v8.11.3 in the base bash" | 
				
			||||||
 | 
					  exit 1 | 
				
			||||||
 | 
					fi | 
				
			||||||
					Loading…
					
					
				
		Reference in new issue