Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar-network-sync
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2012-07-15 23:17:41 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2012-07-15 23:17:41 (GMT)
commit2fdfb1da1ff9cbb778368e29bb40029caf9d8942 (patch)
treedea2d1ecfc2ead9edb7704dbd08900545f4d07d3 /sugar-network-sync
parent741ea800ecdfc0b60d38ab716f20dd7580d932a7 (diff)
Place sugar-network-sync to sync directory
Diffstat (limited to 'sugar-network-sync')
-rwxr-xr-xsugar-network-sync15
1 files changed, 10 insertions, 5 deletions
diff --git a/sugar-network-sync b/sugar-network-sync
index bcabffc..c0584fa 100755
--- a/sugar-network-sync
+++ b/sugar-network-sync
@@ -144,17 +144,22 @@ pull() {
done
}
-if [ $# -eq 0 ]; then
- help
- exit 0
-fi
-
sync_path="$1"
clone_url="$2"
cmdline="$@"
FS=
disk_limit=$(expr 1024 \* 1024 \* 10)
+if [ $# -eq 0 ]; then
+ if [ -e "$(dirname $0)/.sugar-network-sync" ]; then
+ # Script was launched from sync directory, so, process sync
+ sync_path="$PWD"
+ else
+ help
+ exit 0
+ fi
+fi
+
mkdir -p "${sync_path}" || abort "Cannot create ${sync_path} sync directory"
cd "${sync_path}" || abort "Cannot switch to ${sync_path} sync directory"