MOD Support des conversations et passage au protocole n°1 (avancement : erl = 50...
[euphorik.git] / mise_en_prod.rb
index ef1819e..5c5a8f7 100755 (executable)
@@ -1,17 +1,24 @@
 #!/usr/bin/ruby
 
-# la destination
-$dest = 'gburri@euphorik.ch:/var/www/euphorik'
-$dest = $*[0] if $*.length > 1
+def copy_files(dest, opt)    
+   p    "rsync #{opt} index.html #{dest}"
+   `rsync #{opt} index.html #{dest}`
+   `rsync #{opt} -r css #{dest}`
+   `rsync #{opt} -r img #{dest}`
+   `rsync #{opt} -r js #{dest}`
+   `rsync #{opt} -r lightbox #{dest}`
+   `rsync #{opt} -r modules/include #{dest}/modules`
+   `rsync #{opt} -r modules/ebin #{dest}/modules`
+   `rsync #{opt} -r pages #{dest}`
+end
 
-# les options communes
-$opt = ''
-`rsync $opt index.html #{$dest}`
-`rsync $opt -r css #{$dest}`
-`rsync $opt -r img #{$dest}`
-`rsync $opt -r js #{$dest}`
-`rsync $opt -r lightbox #{$dest}`
-`rsync $opt -r modules/include #{$dest}/modules`
-`rsync $opt -r modules/ebin #{$dest}/modules`
-`rsync $opt -r pages #{$dest}`
+if __FILE__ == $0   
+   # la destination
+   $dest = 'gburri@euphorik.ch:/var/www/euphorik'
+   $dest = $*[0] if $*.length > 1
+
+   # les options communes
+   $opt = ''
+   
+   copy_files($dest, $opt)
+end