svelte-on-rails 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/svelte_on_rails/configuration.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 433a24cebdd461077d7c4ebd071d0f8ccfaa37bf640c38988c1a3b2e6d41b3f1
|
4
|
+
data.tar.gz: 6746df6083f635e08dd27e3e94c3fa9e25dc5c26632ffabb9da65fc39364b259
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57ad22eb8057a368e49653eeb1b9f6abce0151b137c2d8f45c59ec702a14471a1da30b9e265bbac5d5f86a0658849fb18cf338515f05d9d9880f0d5897fbf57b
|
7
|
+
data.tar.gz: cdca6d74748f650862b5a815e3d7c90d1863b501582128d182578888092c003190b4a1a80893ffcd20e2acd27c6f0ac0b0b06e47efc80541b9e4eeb2cb25e68b
|
data/README.md
CHANGED
@@ -81,7 +81,7 @@ If you have issues, please open one, and contributors are welcome!
|
|
81
81
|
- npm on latest versions
|
82
82
|
- node installed.
|
83
83
|
- If node is not included on the PATH you can configure your node path by environment variable `SVELTE_ON_RAILS_NODE_BIN`
|
84
|
-
-
|
84
|
+
- if `nvm` is installed it gets the path to the node-binary from there.
|
85
85
|
|
86
86
|
## Installation from cero ⚙️
|
87
87
|
|
@@ -108,11 +108,13 @@ module SvelteOnRails
|
|
108
108
|
n = ENV['SVELTE_ON_RAILS_NODE_BIN'] || 'node'
|
109
109
|
|
110
110
|
if n == 'node'
|
111
|
-
|
112
|
-
|
113
|
-
|
111
|
+
|
112
|
+
nvm_installed = false
|
113
|
+
nvm_dir = ENV['NVM_DIR'] || File.expand_path('~/.nvm')
|
114
|
+
nvm_installed ||= File.exist?("#{nvm_dir}/nvm.sh")
|
115
|
+
|
116
|
+
if nvm_installed
|
114
117
|
# Use NVM_DIR if set, otherwise default to ~/.nvm
|
115
|
-
nvm_dir = ENV['NVM_DIR'] || File.expand_path('~/.nvm')
|
116
118
|
command = "[ -s \"#{nvm_dir}/nvm.sh\" ] && . \"#{nvm_dir}/nvm.sh\" && nvm which current"
|
117
119
|
node_path, status = Open3.capture2("bash -lc '#{command}'")
|
118
120
|
|
@@ -128,7 +130,7 @@ module SvelteOnRails
|
|
128
130
|
|
129
131
|
n
|
130
132
|
rescue StandardError => e
|
131
|
-
raise "Failed to detect Node.js binary:
|
133
|
+
raise "Failed to detect Node.js binary: «#{e.message}». Ensure Node.js is installed and accessible, or set SVELTE_ON_RAILS_NODE_BIN."
|
132
134
|
end
|
133
135
|
end
|
134
136
|
|