From 8850c84216c51b11779390c8dabfec60efdd2b04 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Thu, 27 Aug 2015 04:41:38 +0900 Subject: [PATCH 1/3] ignore themes directory --- .gitignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 989e7cb..af3ddd1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,7 @@ pkg/** !pkg/omf !pkg/omf/** -themes/** -!themes/default/* +themes/ .DS_Store **/.DS_Store From c855e0024ce332c18de7d60ad961b52275f701f5 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Thu, 27 Aug 2015 04:43:01 +0900 Subject: [PATCH 2/3] fix omf new theme and remove default theme --- .gitignore | 2 +- bin/install | 1 - pkg/omf/cli/omf_list_themes.fish | 2 +- pkg/omf/cli/omf_new.fish | 2 +- pkg/omf/cli/omf_remove_package.fish | 6 +----- pkg/omf/omf.fish | 2 +- 6 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index af3ddd1..525a939 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ pkg/** !pkg/omf !pkg/omf/** -themes/ +themes/** .DS_Store **/.DS_Store diff --git a/bin/install b/bin/install index 2776bbf..e5b7bf0 100755 --- a/bin/install +++ b/bin/install @@ -103,7 +103,6 @@ omf_install() { if [ ! -d "${OMF_CONFIG}" ]; then echo "Writing Oh My Fish configuration → ${OMF_CONFIG}" mkdir -p "${OMF_CONFIG}" - test -f "${OMF_CONFIG}/theme" || echo default > "${OMF_CONFIG}/theme" test -f "${OMF_CONFIG}/revision" || echo ${git_rev} > "${OMF_CONFIG}/revision" fi } diff --git a/pkg/omf/cli/omf_list_themes.fish b/pkg/omf/cli/omf_list_themes.fish index 117b0ae..9aaeb09 100644 --- a/pkg/omf/cli/omf_list_themes.fish +++ b/pkg/omf/cli/omf_list_themes.fish @@ -1,7 +1,7 @@ function omf_list_themes set -l seen "" for theme in (basename $OMF_PATH/db/themes/*) \ - (basename {$OMF_PATH,$OMF_CUSTOM}/themes/*) + (basename {$OMF_PATH,$OMF_CUSTOM}/themes/*) contains $theme $seen; or echo $theme set seen $seen $theme end diff --git a/pkg/omf/cli/omf_new.fish b/pkg/omf/cli/omf_new.fish index acbcad6..4ee6c91 100644 --- a/pkg/omf/cli/omf_new.fish +++ b/pkg/omf/cli/omf_new.fish @@ -23,7 +23,7 @@ function omf_new -a option name set -l user (git config user.name) test -z "$user"; and set user "{{USERNAME}}" - omf_new_from_template "$OMF_PATH/pkg/wa/templates/$option" \ + omf_new_from_template "$OMF_PATH/pkg/omf/templates/$option" \ $github $user $name echo (omf::em)"Switched to $dir"(omf::off) diff --git a/pkg/omf/cli/omf_remove_package.fish b/pkg/omf/cli/omf_remove_package.fish index bfcb0d1..a572df1 100644 --- a/pkg/omf/cli/omf_remove_package.fish +++ b/pkg/omf/cli/omf_remove_package.fish @@ -13,12 +13,8 @@ function omf_remove_package emit uninstall_$pkg rm -rf $OMF_PATH/pkg/$pkg else if test -d $OMF_PATH/themes/$pkg - if test $pkg = default - echo (omf::err)"You can't remove the default theme"(omf::off) 1^&2 - return $OMF_INVALID_ARG - end if test $pkg = (cat $OMF_CONFIG/theme) - omf_theme "default" + echo "" > $OMF_CONFIG/theme end rm -rf $OMF_PATH/themes/$pkg end diff --git a/pkg/omf/omf.fish b/pkg/omf/omf.fish index f1a98e0..1c77670 100644 --- a/pkg/omf/omf.fish +++ b/pkg/omf/omf.fish @@ -76,7 +76,7 @@ function omf -d "Oh My Fish" return $OMF_INVALID_ARG end - case "r" "rm" "remove" "uninstall" + case "r" "rem" "rm" "remove" "uninstall" if test (count $argv) -ne 2 echo (omf::err)"Invalid number of arguments"(omf::off) 1^&2 echo "Usage: $_ "(omf::em)"$argv[1]"(omf::off)" <[package|theme] name>" 1^&2 From 7a7b0ff393b026919d4f7b791fe5a5b062bb6614 Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Thu, 27 Aug 2015 06:15:17 +0900 Subject: [PATCH 3/3] create empty theme config file during install --- bin/install | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/install b/bin/install index e5b7bf0..ea45b13 100755 --- a/bin/install +++ b/bin/install @@ -103,6 +103,7 @@ omf_install() { if [ ! -d "${OMF_CONFIG}" ]; then echo "Writing Oh My Fish configuration → ${OMF_CONFIG}" mkdir -p "${OMF_CONFIG}" + touch "${OMF_CONFIG}/theme" test -f "${OMF_CONFIG}/revision" || echo ${git_rev} > "${OMF_CONFIG}/revision" fi }