From 8816edd80582887015fc927beedb5c9245ee9783 Mon Sep 17 00:00:00 2001 From: MaYuming Date: Fri, 30 Jun 2017 17:03:50 +0800 Subject: [PATCH 1/5] fix mkcd issue #993 --- plugins/available/base.plugin.bash | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 5450a416..5b1da887 100755 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -88,7 +88,7 @@ function pmdown () echo "You don't have a markdown command installed!" fi } - +#if using mkcd many dirs, it will make all dirs and cd into the lastest one. function mkcd () { about 'make a directory and cd into it' @@ -96,8 +96,7 @@ function mkcd () example '$ mkcd foo' example '$ mkcd /tmp/img/photos/large' group 'base' - mkdir -p -- "$*" - cd -- "$*" + mkdir -p "$@" && eval cd "\"\$$#\"" } function lsgrep () From f19a8b88eba664abb7abb1e0ec2209d9d644cb71 Mon Sep 17 00:00:00 2001 From: MaYuming Date: Fri, 30 Jun 2017 18:27:43 +0800 Subject: [PATCH 2/5] Revert "fix mkcd issue #993" This reverts commit 8816edd80582887015fc927beedb5c9245ee9783. --- plugins/available/base.plugin.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 5b1da887..5450a416 100755 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -88,7 +88,7 @@ function pmdown () echo "You don't have a markdown command installed!" fi } -#if using mkcd many dirs, it will make all dirs and cd into the lastest one. + function mkcd () { about 'make a directory and cd into it' @@ -96,7 +96,8 @@ function mkcd () example '$ mkcd foo' example '$ mkcd /tmp/img/photos/large' group 'base' - mkdir -p "$@" && eval cd "\"\$$#\"" + mkdir -p -- "$*" + cd -- "$*" } function lsgrep () From f369efe953a62abc1012daf70d932bd9f568b2e8 Mon Sep 17 00:00:00 2001 From: MaYuming Date: Fri, 30 Jun 2017 18:45:22 +0800 Subject: [PATCH 3/5] mkcd one or more dirs --- plugins/available/base.plugin.bash | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 5450a416..e028051a 100755 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -91,13 +91,14 @@ function pmdown () function mkcd () { - about 'make a directory and cd into it' - param 'path to create' + about 'make one or more directorys and cd into the lastest one' + param 'one or more directorys to create' example '$ mkcd foo' example '$ mkcd /tmp/img/photos/large' + example '$ mkcd foo foo1 foo2 fooN' + example '$ mkcd /tmp/img/photos/large tmp/img/photos/self tmp/img/photos/Beijing' group 'base' - mkdir -p -- "$*" - cd -- "$*" + mkdir -p -- "$@" && eval cd -- "\"\$$#\"" } function lsgrep () From 6be02f8062e55a1a3679861f6d12cc3beffcd71b Mon Sep 17 00:00:00 2001 From: MaYuming Date: Fri, 30 Jun 2017 20:09:22 +0800 Subject: [PATCH 4/5] Revert "mkcd one or more dirs" This reverts commit f369efe953a62abc1012daf70d932bd9f568b2e8. --- plugins/available/base.plugin.bash | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index e028051a..5450a416 100755 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -91,14 +91,13 @@ function pmdown () function mkcd () { - about 'make one or more directorys and cd into the lastest one' - param 'one or more directorys to create' + about 'make a directory and cd into it' + param 'path to create' example '$ mkcd foo' example '$ mkcd /tmp/img/photos/large' - example '$ mkcd foo foo1 foo2 fooN' - example '$ mkcd /tmp/img/photos/large tmp/img/photos/self tmp/img/photos/Beijing' group 'base' - mkdir -p -- "$@" && eval cd -- "\"\$$#\"" + mkdir -p -- "$*" + cd -- "$*" } function lsgrep () From d88b0683636d889106895f3ca37aac5e97c01d1c Mon Sep 17 00:00:00 2001 From: MaYuming Date: Fri, 30 Jun 2017 20:14:32 +0800 Subject: [PATCH 5/5] fix mkcd issue --- plugins/available/base.plugin.bash | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/available/base.plugin.bash b/plugins/available/base.plugin.bash index 5450a416..4ddfa5ca 100755 --- a/plugins/available/base.plugin.bash +++ b/plugins/available/base.plugin.bash @@ -91,13 +91,14 @@ function pmdown () function mkcd () { - about 'make a directory and cd into it' - param 'path to create' + about 'make one or more directories and cd into the last one' + param 'one or more directories to create' example '$ mkcd foo' example '$ mkcd /tmp/img/photos/large' + example '$ mkcd foo foo1 foo2 fooN' + example '$ mkcd /tmp/img/photos/large /tmp/img/photos/self /tmp/img/photos/Beijing' group 'base' - mkdir -p -- "$*" - cd -- "$*" + mkdir -p -- "$@" && eval cd -- "\"\$$#\"" } function lsgrep ()