setup_script_generator 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f533df76844601ae39ebb9eab3238e8b46b6742873708248d6a8a79ad8588c7f
4
- data.tar.gz: 16e7dfb71bdd2d2fac79c7619803a8d49edfcc2c4766bf12e6b17c3842c8dce1
3
+ metadata.gz: 9fa313219d3d72070f83b76129dfa4d88b201e6711c7bf4da9ee88743a2e73f0
4
+ data.tar.gz: f71b035c63680fca762ad81752bf711b239d71f5c4211983a13368e4c5471e6e
5
5
  SHA512:
6
- metadata.gz: d2b177f2ff9d47025a20168f54fa105f023071af4472695b52bf32db120e68a83a79f2f0bfe34bd7cc4dd78ededf7f9707f21692ad92cec4925a4e993790722c
7
- data.tar.gz: 6059f84fd4d3899d7fa1b9e71d911fdba91b2af0e027e57850621556f8fc3dc2f5a7791ec0f70d52d6e2a406d60aac375839988067047368149b4a6e830a087f
6
+ metadata.gz: 05f56f7fab52cb6925f0fe26ab6aa865a7b9e8eb1bffdc9bcc0f9c22730d5edbff03268f77e2401915ac0248265d4895c43f73e25cf98f34e867187de733ca5d
7
+ data.tar.gz: 36579d3cd1018b4d740d845b8ecdee0b4f2441c12fab9105f3303e15949fb891da913175f3c0fbe461c61402f34cb28ff6306b867aa6cff054e31ab64110ee87
@@ -1,27 +1,17 @@
1
- read-required-node-version-for-asdf() {
2
- (cat .tool-versions | grep '^nodejs ' | sed -Ee 's/^nodejs (.+)$/\1/') || \
3
- echo ''
4
- }
5
-
6
1
  provision-node() {
7
2
  if [[ -f .tool-versions ]]; then
8
- REQUIRED_NODE_VERSION=$(read-required-node-version-for-asdf)
9
-
10
- if [[ -z $REQUIRED_NODE_VERSION ]]; then
11
- error "Could not read required Node version."
12
- print-wrapped "\
13
- Please check that .tool-versions is correct before re-running this script."
14
- exit 1
15
- fi
3
+ REQUIRED_NODE_VERSION=$(cat .tool-versions | grep '^nodejs ' | sed -Ee 's/^nodejs (.+)$/\1/')
16
4
  elif [[ -f .node-version ]]; then
17
5
  REQUIRED_NODE_VERSION=$(cat .node-version)
18
6
  elif [[ -f .nvmrc ]]; then
19
7
  REQUIRED_NODE_VERSION=$(cat .nvmrc)
20
- else
21
- error "You don't seem to have a Node version set in your project."
8
+ fi
9
+
10
+ if [[ -z $REQUIRED_NODE_VERSION ]]; then
11
+ error "Could not determine required Node version for this project."
22
12
  print-wrapped "\
23
- You'll need to create either a .tool-versions file or .nvmrc file in your
24
- project before you can run this script."
13
+ Your project needs to include either a valid .tool-versions file with a 'nodejs'
14
+ line or a valid .node-version or .nvimrc file."
25
15
  exit 1
26
16
  fi
27
17
 
@@ -2,14 +2,16 @@ provision-ruby() {
2
2
  USE_BUNDLER_1=0
3
3
 
4
4
  if [[ -f .tool-versions ]]; then
5
- REQUIRED_RUBY_VERSION=$(cat .tool-versions | grep '^ruby ' | sed -Ee 's/^ruby (.+)$/\1/')
5
+ REQUIRED_RUBY_VERSION=$(cat .tool-versions | grep '^ruby ' | head -n 1 | sed -Ee 's/^ruby (.+)$/\1/')
6
6
  elif [[ -f .ruby-version ]]; then
7
- REQUIRED_RUBY_VERSION=$(cat .ruby-version)
8
- else
9
- error "You don't seem to have a Ruby version set in your project."
7
+ REQUIRED_RUBY_VERSION=$(cat .ruby-version | head -n 1 | sed -Ee 's/^ruby-([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)$/\1/')
8
+ fi
9
+
10
+ if [[ -z $REQUIRED_RUBY_VERSION ]]; then
11
+ error "Could not determine required Ruby version for this project."
10
12
  print-wrapped "\
11
- You'll need to create either a .tool-versions file or .ruby-version file in your
12
- project before you can run this script."
13
+ Your project needs to include either a valid .tool-versions file with a 'ruby'
14
+ line or a valid .ruby-version file."
13
15
  exit 1
14
16
  fi
15
17
 
@@ -51,12 +53,6 @@ ensure-ruby-installed() {
51
53
  error "Please use chruby to install Ruby $REQUIRED_RUBY_VERSION!"
52
54
  fi
53
55
  fi
54
- elif has-executable rvm; then
55
- if ! (rvm list | grep $required_ruby_version'\>' &>/dev/null); then
56
- banner "Installing Ruby $required_ruby_version with rvm"
57
- rvm install $required_ruby_version
58
- rvm use $required_ruby_version
59
- fi
60
56
  else
61
57
  error "You don't seem to have a Ruby manager installed."
62
58
  print-wrapped "\
@@ -1,3 +1,3 @@
1
1
  module SetupScriptGenerator
2
- VERSION = "0.2.9".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: setup_script_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elliot Winkler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-30 00:00:00.000000000 Z
11
+ date: 2020-11-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: