whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: add --all, --source, and --no-* options
Date Sat, 30 Nov 2019 15:30:48 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new 8e3a9ba  add --all, --source, and --no-* options
8e3a9ba is described below

commit 8e3a9ba1e432e470d0983af5524ea0f36ec23316
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sat Nov 30 10:30:18 2019 -0500

    add --all, --source, and --no-* options
---
 SETUPMYMAC.MD     |  4 ++--
 config/setupmymac | 44 +++++++++++++++++++++++++++++++++-----------
 2 files changed, 35 insertions(+), 13 deletions(-)

diff --git a/SETUPMYMAC.MD b/SETUPMYMAC.MD
index 8644a5e..684be33 100644
--- a/SETUPMYMAC.MD
+++ b/SETUPMYMAC.MD
@@ -1,6 +1,6 @@
 If you have a MacBook you undoubtedly have never used LDAP on it, have a
 version of the Ruby programming language installed that you also haven't used
-much and the Apache httpd web server is disabled.  Why not put them to use?
+much, and the Apache httpd web server is disabled.  Why not put them to use?
 
 It is easy, run the following two commands:
 
@@ -64,7 +64,7 @@ Once you have both configurations set up running this command again will
change
 permissions on a few files, but generally will leave everything else is the
 same.  If you want to update more (say, to get a new version of `passenger`),
 there are options to do that, enter `whimsy/config/setupmymac --help` for
-details.
+details.  Pass `-all` to update everything.
 
 If you want to know what is going on under the covers with the setupmymac
 scripts, visit either the [macOS](./MACOSX.md) or [Docker](./DOCKER.md)
diff --git a/config/setupmymac b/config/setupmymac
index c0a218f..fd3514a 100755
--- a/config/setupmymac
+++ b/config/setupmymac
@@ -87,24 +87,32 @@ OptionParser.new do |opts|
     option = :docker
   end
 
-  opts.on('--gem', '--gems', "Upgrade gem dependencies") do |opt|
-    force[:gems] = true
+  opts.on('--[no-]gem', '--gems', "Upgrade gem dependencies") do |opt|
+    force[:gems] = opt
   end
 
-  opts.on('--bundle', '--bundler', "Upgrade bundler") do |opt|
-    force[:bundler] = true
+  opts.on('--[no-]bundle', '--bundler', "Upgrade bundler") do |opt|
+    force[:bundler] = opt
   end
 
-  opts.on('--node', "Upgrade to the latest node.js") do |opt|
-    force[:node] = true
+  opts.on('--[no-]node', "Upgrade to the latest node.js") do |opt|
+    force[:node] = opt
   end
 
-  opts.on('--passenger', "Upgrade to the latest Phusion Passenger") do |opt|
-    force[:passenger] = true
+  opts.on('--[no-]passenger', "Upgrade to the latest Phusion Passenger") do |opt|
+    force[:passenger] = opt
   end
 
-  opts.on('--ldap', "Reconfigure LDAP") do |opt|
-    force[:ldap] = true
+  opts.on('--[no-]ldap', "Reconfigure LDAP") do |opt|
+    force[:ldap] = opts
+  end
+
+  opts.on('--[no-]source', "Pull the latest changes to the source code") do |opt|
+    force[:source] = opt
+  end
+
+  opts.on('--all', "Update everything") do |opt|
+    force.default = true
   end
 end.parse!
 
@@ -134,7 +142,11 @@ if Process.uid != 0 and option != :docker
     brew 'upgrade', 'node' 
   end
 
-  run 'npm install -g npm' if `which npm`.empty? or force[:node]
+  if `which npm`.empty?
+    run 'npm install -g npm'
+  elsif force[:node]
+    run 'npm upgrade -g npm'
+  end
 
   # Prompt for xcode installation
   `svn --version`
@@ -184,7 +196,15 @@ if not Dir.exist? '/srv/whimsy'
   end
 end
 
+# update source
+if force[:source] and Process.uid != 0
+  Dir.chdir '/srv/whimsy' do
+    run 'git', 'pull'
+  end
+end
+
 ### Define directories
+
 directories = [
   '/srv/agenda',
   '/srv/cache',
@@ -260,6 +280,7 @@ if `which bundle`.empty?
   sudo {run 'gem install bundler'} 
 elsif force[:bundler]
   sudo {run 'gem update bundler'} 
+  ARGS.push '--no-bundle'
 end
 
 ### Installl gems
@@ -305,6 +326,7 @@ if File.exist? "#{WHIMSY}/Gemfile.lock"
       color '$ ruby -I lib -r whimsy/asf -e "ASF::LDAP.configure"'
       ASF::LDAP.configure
     end
+    ARGS.push '--no-ldap'
   end
 end
 


Mime
View raw message