File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,17 @@ namespace :vue do
8
8
# generate config/vue.yml
9
9
FileUtils . chdir root
10
10
# `vue create .` and dependencies
11
- pm . exec ( 'vue create' , "-n -m #{ pm . package_manager } ." )
11
+ pm . exec ( 'vue create' , '' , "-n -m #{ pm . package_manager } ." )
12
12
pm . add '-D webpack-assets-manifest js-yaml'
13
13
FileUtils . rm_rf root . join ( 'src' )
14
14
15
15
# dirs under `app`
16
16
src_dir = Pathname . new ( __FILE__ ) . dirname . join ( '..' , 'source' )
17
17
FileUtils . cp_r ( src_dir . join ( 'app' ) , root )
18
- FileUtils . cp ( src_dir . join ( 'vue.config.js' ) , root . join ( 'vue.config.js' ) )
18
+ binding . pry
19
+ Dir [ src_dir . join ( 'vue.*.js' ) ] . each do |fn |
20
+ FileUtils . cp ( fn , "#{ root } /" )
21
+ end
19
22
20
23
yml = src_dir . join ( 'vue.yml' ) . read
21
24
yml = yml . sub ( '#PACKAGE_MANAGER' , pm . package_manager . to_s )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def package_manager
33
33
@pm
34
34
end
35
35
36
- def exec ( command , args = nil )
36
+ def exec ( command , args = nil , extra = nil )
37
37
cmd = COMMAND_LINE [ command . to_sym ] || { }
38
38
if @pm == :yarn && cmd [ :yarn ]
39
39
cmd = cmd [ :yarn ]
@@ -45,7 +45,8 @@ def exec(command, args = nil)
45
45
cmd = @pm == :yarn ? "yarn exec #{ command } " : "npx #{ command } "
46
46
end
47
47
48
- cmd = "#{ cmd } #{ @pm == :yarn ? '-- ' : '' } #{ args } " if args . present?
48
+ cmd = "#{ cmd } #{ args } " if args . present?
49
+ cmd = "#{ cmd } #{ @pm == :yarn ? '-- ' : '' } #{ extra } " if extra . present?
49
50
puts "run: #{ cmd } "
50
51
system ( cmd )
51
52
end
You can’t perform that action at this time.
0 commit comments