Permalink
Browse files

various fixes

  • Loading branch information...
m4rco- committed May 7, 2013
1 parent 8040743 commit 16df8c626ec1e776352f74674b41890980d4f2eb
Showing with 18 additions and 11 deletions.
  1. +3 −0 .gitignore
  2. +4 −4 bin/dorothy_start
  3. +2 −2 bin/dorothy_stop
  4. +9 −5 lib/dorothy2/do-init.rb
View
@@ -1,5 +1,6 @@
*.gem
*.rbc
+*.log
.DS_Store
.bundle
.config
@@ -9,6 +10,8 @@ InstalledFiles
_yardoc
coverage
doc/
+var/
+opt/
lib/bundler/man
pkg
rdoc
View
@@ -6,9 +6,9 @@
require 'rubygems'
require 'trollop'
-#require 'dorothy2' #comment for testing/developmnet
+require 'dorothy2' #comment for testing/developmnet
-load '../lib/dorothy2.rb' #uncomment for testing/developmnet
+#load '../lib/dorothy2.rb' #uncomment for testing/developmnet
include Dorothy
@@ -142,12 +142,12 @@ if Util.exists?(sfile)
end
end
else
- puts "[WARNING]".red + " A source file doesn't exist, please crate one in the /etc folder"
+ puts "[WARNING]".red + " A source file doesn't exist, please crate one into #{home}/etc. See the example file in #{HOME}/etc/sandboxes.yml.example"
exit(0)
end
unless Util.exists?(sboxfile)
- puts "[WARNING]".red + " There is no sandbox configured yet. Please do it now"
+ puts "[WARNING]".red + " There is no sandbox configured yet. Please do it now."
DoroConfig.create_sandbox(sboxfile)
DoroConfig.init_sandbox(sboxfile)
end
View
@@ -8,9 +8,9 @@
require 'rubygems'
require 'trollop'
-#require 'dorothy2'
+require 'dorothy2'
-load '../lib/dorothy2.rb'
+#load '../lib/dorothy2.rb'
include Dorothy
View
@@ -11,13 +11,17 @@ module DoroConfig
def init_home(home)
puts "INIT".yellow + " Creating Directoy structure in #{home}"
Dir.mkdir(home)
- Dir.mkdir("#{home}/opt")
- Dir.mkdir("#{home}/opt/bins")
- Dir.mkdir("#{home}/opt/analyzed")
+ unless Utils.exists?("#{home}/opt")
+ Dir.mkdir("#{home}/opt")
+ Dir.mkdir("#{home}/opt/bins")
+ Dir.mkdir("#{home}/opt/analyzed")
+ end
Dir.mkdir("#{home}/etc")
Dir.mkdir("#{home}/etc/geo")
- Dir.mkdir("#{home}/var")
- Dir.mkdir("#{home}/var/log")
+ unless Utils.exists?("#{home}/var")
+ Dir.mkdir("#{home}/var")
+ Dir.mkdir("#{home}/var/log")
+ end
puts "INIT".yellow + " Done"
end

0 comments on commit 16df8c6

Please sign in to comment.