bin/lipsiahosting in lipsiahosting-1.0.1 vs bin/lipsiahosting in lipsiahosting-1.0.2
- old
+ new
@@ -8,22 +8,23 @@
cmd.add_command(CmdParse::HelpCommand.new)
cmd.add_command(CmdParse::VersionCommand.new)
# lipsiahosting init
init = CmdParse::Command.new("init", false)
-init.short_desc = "Init a new repository for the given user, ex: lipsiahosting init d.dagostino."
+init.short_desc = "Init a new repository for the given user, ex: lipsiahosting init -u d.dagostino -s server1"
init.options = CmdParse::OptionParserWrapper.new do |opt|
+ opt.on( '-u', '--user USER', 'Set your lipsiahosting user ex -u d.dagostino' ) { |value| $user = value }
+ opt.on( '-s', '--server USER', 'Set your lipsiahosting server ex -s server1' ) { |value| $server = value }
opt.on( '-i', '--ignore DIRECTORIES', 'Set folder/file to ignore split it by "," ex: "some/folder/*,another/folder/**/*"' ) { |value| $ignores = value }
end
init.set_execution_block do |args|
- user = args[0]
- if !user
+ if !$user || !$server
init.show_help
exit 1
end
ignores = $ignores.split(",") rescue []
- puts "-> Your username is: #{user}"
+ puts "-> Your username is: #{$user}"
puts "Removing *.svn folders"
system "find . -name .svn -print0 | xargs -0 rm -rf"
puts "Removing *.git folders"
system "find . -name .git -print0 | xargs -0 rm -rf"
puts "Removeing .gitignore"
@@ -49,10 +50,10 @@
end
system "git add .gitignore"
puts "Committing application locally"
system "git add *"
system 'git commit -a -m "initial import of site" > /dev/null'
- system "git remote add origin git@server1.lipsiasoft.com:#{user}/#{project}.git"
+ system "git remote add origin git@#{$server}.lipsiasoft.com:#{$user}/#{project}.git"
puts "Pushing application to the remote server. The name of the branch is:"
system "git remote"
system "git push origin master"
end
cmd.add_command(init)
\ No newline at end of file