Skip to content

Commit 31cb90f

Browse files
committed
fixed small bugs
1 parent a8626ec commit 31cb90f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lib/tasks/vue.rake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ namespace :vue do
88
# generate config/vue.yml
99
FileUtils.chdir root
1010
# `vue create .` and dependencies
11-
pm.exec('vue create', "-n -m #{pm.package_manager} .")
11+
pm.exec('vue create', '', "-n -m #{pm.package_manager} .")
1212
pm.add '-D webpack-assets-manifest js-yaml'
1313
FileUtils.rm_rf root.join('src')
1414

1515
# dirs under `app`
1616
src_dir = Pathname.new(__FILE__).dirname.join('..', 'source')
1717
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
1922

2023
yml = src_dir.join('vue.yml').read
2124
yml = yml.sub('#PACKAGE_MANAGER', pm.package_manager.to_s)

lib/vue_cli/rails/node_env.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def package_manager
3333
@pm
3434
end
3535

36-
def exec(command, args = nil)
36+
def exec(command, args = nil, extra = nil)
3737
cmd = COMMAND_LINE[command.to_sym] || {}
3838
if @pm == :yarn && cmd[:yarn]
3939
cmd = cmd[:yarn]
@@ -45,7 +45,8 @@ def exec(command, args = nil)
4545
cmd = @pm == :yarn ? "yarn exec #{command}" : "npx #{command}"
4646
end
4747

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?
4950
puts "run: #{cmd}"
5051
system(cmd)
5152
end

0 commit comments

Comments
 (0)