From bf9daf6488d0902977318441bcd666a32389593a Mon Sep 17 00:00:00 2001 From: Tymon Radzik Date: Sun, 28 Dec 2014 15:41:55 +0100 Subject: [PATCH 1/4] Fixed issue #254 --- bin/sup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/sup b/bin/sup index 67573121d..e1dd6cec5 100755 --- a/bin/sup +++ b/bin/sup @@ -168,6 +168,12 @@ begin end end + if Redwood::SourceManager.sources.empty? + debug "No sources found! - running sup-config" + exec("sup-config") + abort + end + if(s = Redwood::SourceManager.source_for DraftManager.source_name) DraftManager.source = s else @@ -432,5 +438,4 @@ EOS puts e.message, e.backtrace end end - end From e1af25636c79e5823f4fc0aa241226e7ec8479c2 Mon Sep 17 00:00:00 2001 From: ty221 Date: Tue, 30 Dec 2014 11:13:12 +0100 Subject: [PATCH 2/4] Fixed autostarting of sup-config --- bin/sup | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/sup b/bin/sup index e1dd6cec5..62a699cde 100755 --- a/bin/sup +++ b/bin/sup @@ -152,10 +152,18 @@ end module_function :start_cursing, :stop_cursing Index.init -Index.lock_interactively or exit begin Redwood::start + Redwood::SourceManager.load_sources + + if Redwood::SourceManager.sources.empty? + debug "No sources found!" + exec("sup-config") + abort + end + + Index.lock_interactively or exit Index.load Redwood::check_syncback_settings Index.start_sync_worker unless $opts[:no_threads] @@ -168,12 +176,6 @@ begin end end - if Redwood::SourceManager.sources.empty? - debug "No sources found! - running sup-config" - exec("sup-config") - abort - end - if(s = Redwood::SourceManager.source_for DraftManager.source_name) DraftManager.source = s else From ca0ec646b3946ed3e6b91507ec6d3f7dd7131be0 Mon Sep 17 00:00:00 2001 From: ty221 Date: Wed, 31 Dec 2014 12:24:24 +0100 Subject: [PATCH 3/4] Fixed index.lock as in disscussion --- bin/sup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/sup b/bin/sup index 62a699cde..8163437bd 100755 --- a/bin/sup +++ b/bin/sup @@ -152,6 +152,7 @@ end module_function :start_cursing, :stop_cursing Index.init +Index.lock_interactively or exit begin Redwood::start @@ -159,11 +160,11 @@ begin if Redwood::SourceManager.sources.empty? debug "No sources found!" + Index.unlock exec("sup-config") abort end - Index.lock_interactively or exit Index.load Redwood::check_syncback_settings Index.start_sync_worker unless $opts[:no_threads] From 554404ff182abb273af1617e3f18a1b3a42db830 Mon Sep 17 00:00:00 2001 From: ty221 Date: Wed, 14 Jan 2015 23:56:15 +0100 Subject: [PATCH 4/4] Added eMBee's suggestion --- bin/sup | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/sup b/bin/sup index 8163437bd..ca312109b 100755 --- a/bin/sup +++ b/bin/sup @@ -158,11 +158,12 @@ begin Redwood::start Redwood::SourceManager.load_sources - if Redwood::SourceManager.sources.empty? + if Redwood::SourceManager.sources.empty? and !File.exist?("#{Dir.home}/.sup/configured") debug "No sources found!" + FileUtils.touch("#{Dir.home}/.sup/configured") Index.unlock exec("sup-config") - abort + abort end Index.load