roda-vite 0.3.0 → 0.4.0
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/lib/version.rb +1 -1
- data/lib/vite_roda/lib/vite_roda/installation.rb +9 -6
- 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: 6864daee0925a1e81ab534655fa8d1ed70d539be7cbd8e528672960a32c1f099
|
4
|
+
data.tar.gz: ed4f38b88404153306f3286f912374bcd776c46d88f7ba157ff9539b3c95094a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f28f886399c794f6780895f781b34ea93702e932b893d8686a63789b61394c4fbffd38af5055551429be51e947c1d951dfd45dfa1939bd648468767e2110be9
|
7
|
+
data.tar.gz: 5e31e65cd17862fc47a309e54c50989095ca35fb83116a2a6e4c9d665fc89cc5bd6ccd8feca7b88d87f5975e4e4027063f843c891d77c5acf8d1131a23dbeb40
|
data/lib/version.rb
CHANGED
@@ -21,9 +21,14 @@ module ViteRoda::Installation
|
|
21
21
|
# super
|
22
22
|
# end
|
23
23
|
|
24
|
-
|
24
|
+
# Add additional options
|
25
|
+
def self.prepended(base)
|
26
|
+
base.option :force, type: :flag, aliases: ['-f'], desc: "Force installation, skip checking that 'plugin :vite' was added."
|
27
|
+
end
|
28
|
+
|
29
|
+
def call(package_manager: nil, **options)
|
25
30
|
|
26
|
-
ensure_roda_plugin_added
|
31
|
+
ensure_roda_plugin_added unless options[:force]
|
27
32
|
|
28
33
|
ENV["VITE_RUBY_PACKAGE_MANAGER"] ||= package_manager if package_manager
|
29
34
|
|
@@ -67,10 +72,8 @@ module ViteRoda::Installation
|
|
67
72
|
# Internal: Ensures the Vite plugin is loaded in app.rb, or [app_name].rb
|
68
73
|
# This check is skipped if the -f or --force flag is passed
|
69
74
|
def ensure_roda_plugin_added
|
70
|
-
|
71
|
-
|
72
|
-
unless line_with_prefix_exists? root.join('app.rb'), 'plugin :vite' ||
|
73
|
-
line_with_prefix_exists? root.join("#{app_name}.rb"), 'plugin :vite'
|
75
|
+
unless line_with_prefix_exists?(root.join('app.rb'), 'plugin :vite') ||
|
76
|
+
line_with_prefix_exists?(root.join("#{app_name}.rb"), 'plugin :vite')
|
74
77
|
abort "Add plugin :vite to your Roda app (found in app.rb or #{app_name}.rb) before installing, or pass -f to force."
|
75
78
|
end
|
76
79
|
end
|