Skip to content

tsubasaogawa/slsenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

slsenv

Serverless Framework version manager inspired by/cloned from Kopsenv.

Installation

  1. Check out slsenv into any path (here is ${HOME}/.slsenv)
$ git clone https://github.com/tsubasaogawa/slsenv.git ~/.slsenv
  1. Add ~/.slsenv/bin to your $PATH any way you like
$ echo 'export PATH="$HOME/.slsenv/bin:$PATH"' >> ~/.bash_profile

Usage

slsenv install/uninstall [version]

$ slsenv install v3.34.0
$ slsenv install latest

slsenv use [version]

$ slsenv use v3.34.0
$ slsenv use latest

slsenv list

List installed versions

$ slsenv list
* v1.83.3 (set by /home/t_ogawa/.slsenv/version)
  v3.34.0
  v3.33.0

slsenv list-remote

List installable versions

$ slsenv list-remote
v3.34.0
v3.33.0
v3.32.2
v3.32.1
...

.sls-version file

If you put a .sls-version file on your project root, or in your home directory, slsenv detects it and uses the version written in it. If the version is latest or latest:<regex>, the latest matching version currently installed will be selected.

$ echo v3.32.0 > .sls-version

$ sls --version
Framework Core: 3.32.0 (standalone)
Plugin: 6.2.3
SDK: 4.3.2

$ echo v3.34.0 > .sls-version

$ sls --version
Framework Core: 3.34.0 (standalone)
Plugin: 6.2.3
SDK: 4.3.2

$ echo latest:^v3.32 > .sls-version

$ sls --version
Framework Core: 3.32.0 (standalone)
Plugin: 6.2.3
SDK: 4.3.2

Upgrading

$ git --git-dir=~/.slsenv/.git pull

Uninstalling

$ rm -rf /some/path/to/slsenv