Remove scripts directory in favor functions/ or root/

Remove scripts directory in favor of using the functions/ or root
for sharing scripts. Using a scripts directory does not solve the
main problem of sharing scripts with the same name, so this addition
was deemed of little value. In the future, a more robust way to avoid
name collisions when sharing scripts would be nice to have, but at
the moment having a scripts directory is not solving this problem
but just adding clutter to the configuration.

Closes #105.
This commit is contained in:
Jorge Bucaran 2016-02-18 06:42:12 +09:00
parent 3daabaa207
commit 7de51e7436
13 changed files with 35 additions and 60 deletions

View File

@ -1,20 +1,38 @@
# Change Log
## [0.8.0][v080] - 2016-02-15
## [0.8.0][v080] - 2016-02-17
* Add new **debug** mode enabled by setting a new `$fisher_debug` global / universal variable. For advanced logging and color options, install: [`fish_debug`](https://github.com/fishery/debug).
* Welcome aboard @pickfire, our newest Fisherman organization member*!*
* Add a new ***debug*** :bug: mode that can be enabled by setting the new `$fisher_debug` global variable.
```fish
fisher install debug
set -g fish_debug # or set -gx fish_debug
```
This mode makes commands behave verbosely and forces Fisherman to log all kinds of diagnostic information as well as run some simple health checks.
This mode makes commands behave more verbosely and causes Fisherman to log all kinds of diagnostic information.
* Several updates to the [website][http://fisherman.sh]. Changed to using the new SVG logo. More appeal using grammar tweaks. Drop some hardly ever used favicons and switch from SourceCodePro to Monaco style monospace fonts that load faster and cause less pollution.
The default behavior is to log everything. To filter a specific set of logs add one or more keywords to the `fish_debug` variable.
* Renamed core function `wait` to `spin` to reflect usage more accurately and updated its usage across Fisherman accordingly.
```fish
set -gx fish_debug install uninstall
```
* Renamed `$fisher_key_bindings` variable to `$fisher_binds` because it's shorter to type and makes `config.fish` look neater.
The above will cause logs with *only* those keywords to be displayed. In this case, `fisher_install` and `fisher_uninstall`
* **Rewrite** the Fisherman installer with a new and improved look and added a `TRY_ME` mode in which Fisherman is not installed and the installer explains what will be run in the user's machine.
![Installing Fisherman](https://cloud.githubusercontent.com/assets/8317250/13040276/5f0e5350-d3ed-11e5-8994-3488f80c6494.gif)
* **Rename** core function `wait` to `spin` to reflect usage more accurately and updated its usage across Fisherman accordingly.
* :warning: **Remove** `scripts` directory in favor of using a `functions` or the root directory for sharing scripts. Using a `scripts` directory does not solve the main problem of sharing scripts with the same name, so this addition was deemed of little value. In the future, a more robust way to avoid name collisions when sharing scripts would be nice to have, but at the moment having a `scripts` directory is not solving this problem but just adding clutter to the configuration. Closes #105.
* **Update** [website](http://fisherman.sh) to use the new SVG logo. Improve wording. Drop some hardly ever used *.favicons* and switch from `SourceCodePro` to `Monaco` style monospace fonts that will load faster as we don't have to include the font sources.
* **Rename** `$fisher_key_bindings` variable to `$fisher_binds` because it's shorter to type and makes `config.fish` look neater.
* **Add** user configuration before sourcing Fisherman configuration. Closes #104.
## [0.7.0][v070] - 2016-02-11

View File

@ -7,7 +7,7 @@ function __fisher_plugin_enable -a plugin path
# While this is true for fish_prompt and fish_right_prompt, a prompt is no
# different from other plugins and may optionally include other functions,
# shared scripts, completions, documentation, etc.
# scripts, completions, documentation, etc., which need also be removed.
__fisher_plugin_disable "$fisher_prompt" "$fisher_cache/$fisher_prompt"
end

View File

@ -27,16 +27,10 @@ function __fisher_plugin_walk -a plugin path
end
end
for prefix in functions scripts ""
for file in $path/$prefix/*.{py,rb,php,pl,awk,sed}
set -l base (basename $file)
for file in $path/{functions/,}*.{py,rb,php,pl,awk,sed}
set -l base (basename $file)
if test -z "$prefix"
set prefix functions
end
printf "%s %s %s\n" -- $file $prefix/$base
end
printf "%s %s %s\n" -- $file functions/$base
end
for n in (seq 9)

View File

@ -97,7 +97,7 @@ function fisher_install -d "Install Plugins"
set index (math $index + 1)
end
command mkdir -p $fisher_config/{functions,scripts,completions,conf.d,man} $fisher_cache
command mkdir -p $fisher_config/{functions,completions,conf.d,man} $fisher_cache
set -l path $fisher_cache/$name

View File

@ -73,7 +73,7 @@ Shortcuts to other common Git repository hosting services are also available:
.IP "" 0
.
.P
If a URL is given, the repository is cloned to \fB$fisher_cache\fR the first time and any relevant plugin files are copied to \fB$fisher_config\fR functions, completions, conf\.d, scripts and man directories\.
If a URL is given, the repository is cloned to \fB$fisher_cache\fR the first time and any relevant plugin files are copied to \fB$fisher_config\fR functions, completions, conf\.d and man directories\.
.
.P
If the plugin already exists in \fB$fisher_cache\fR, the files are only copied to \fB$fisher_config\fR\. To update a plugin use \fBfisher update\fR\.

View File

@ -28,7 +28,7 @@ Shortcuts to other common Git repository hosting services are also available:
* *gl*/owner/repo `>` https://gitlab.com/owner/repo<br>
* *omf*/owner/repo `>` https://github.com/oh-my-fish/repo<br>
If a URL is given, the repository is cloned to `$fisher_cache` the first time and any relevant plugin files are copied to `$fisher_config` functions, completions, conf.d, scripts and man directories.
If a URL is given, the repository is cloned to `$fisher_cache` the first time and any relevant plugin files are copied to `$fisher_config` functions, completions, conf.d and man directories.
If the plugin already exists in `$fisher_cache`, the files are only copied to `$fisher_config`. To update a plugin use `fisher update`.

View File

@ -23,7 +23,7 @@ The home directory\. If you installed Fisherman using the recommended method \fB
.
.TP
\fB$fisher_config\fR
The user configuration directory\. This is default location of your user \fIfishfile\fR, Fisherman \fIkey_bindings\.fish\fR file and the \fIcache\fR, \fIfunctions\fR, \fIcompletions\fR, \fIconf\.d\fR and \fIscripts\fR directories\. \fB$XDG_CONFIG_HOME/fisherman\fR by default\.
The user configuration directory\. This is default location of your user \fIfishfile\fR, Fisherman \fIkey_bindings\.fish\fR file and the \fIcache\fR, \fIfunctions\fR, \fIcompletions\fR and \fIconf\.d\fR directories\. \fB$XDG_CONFIG_HOME/fisherman\fR by default\.
.
.TP
\fB$fisher_file\fR

View File

@ -17,7 +17,7 @@ Using the following variables, you can customize the locations of the cache, ind
The home directory. If you installed Fisherman using the recommended method `curl -sL install.fisherman.sh | fish`, the location will be `$XDG_DATA_HOME/fisherman`. If you clone Fisherman and run `make` yourself, `$fisher_home` will the current working directory.
* `$fisher_config`:
The user configuration directory. This is default location of your user *fishfile*, Fisherman *key_bindings.fish* file and the *cache*, *functions*, *completions*, *conf.d* and *scripts* directories. `$XDG_CONFIG_HOME/fisherman` by default.
The user configuration directory. This is default location of your user *fishfile*, Fisherman *key_bindings.fish* file and the *cache*, *functions*, *completions* and *conf.d* directories. `$XDG_CONFIG_HOME/fisherman` by default.
* `$fisher_file`:
This file keeps a list of what plugins you have installed and are currently enabled. `$fisher_config/fishfile` by default. See `fisher help fishfile` for details.

View File

@ -20,7 +20,6 @@
-- functions/foobar.pl
-- functions/foobar.awk
-- functions/foobar.sed
-- scripts/norf.py
-- functions/quux.awk
--man man/man1/foobar.1
--man man/man2/foobar.2

View File

@ -23,7 +23,7 @@ test "$TESTNAME - Local paths are installed as symbolic links"
-L $path/config/cache/baz
end
for file in cache completions conf.d functions man scripts fishfile key_bindings.fish
for file in cache completions conf.d functions man fishfile key_bindings.fish
test "$TESTNAME - Add plugin $file to \$fisher_config/$file"
-e $path/config/$file
end
@ -39,10 +39,6 @@ test "$TESTNAME - Add plugin key bindings to key_bindings.fish"
"##foobar## ##foobar##" = (cat $path/config/key_bindings.fish | xargs)
end
test "$TESTNAME - Add <plugin>/scripts/ to scripts directory"
-e $path/config/scripts/norf.py
end
test "$TESTNAME - cache/.index is a copy of the URL in \$fisher_index"
(cat $path/config/cache/.index) = (cat $DIRNAME/fixtures/plugins/index)
end

View File

@ -1,25 +0,0 @@
set -l path $DIRNAME/.t-$TESTNAME-(random)
set -l extensions py rb php pl awk sed
function -S setup
mkdir -p $path/{foo/scripts,bar}
touch $path/foo/scripts/foo.{$extensions}
touch $path/bar/bar.{$extensions}
end
function -S teardown
rm -rf $path
end
test "$TESTNAME - Do not source scripts/*.{$extensions} files"
(__fisher_plugin_walk foo $path/foo | awk '{ print $1 }') = --
end
test "$TESTNAME - Move <plugin>/scripts/*.{$extensions} TO scripts/*"
(__fisher_plugin_walk foo $path/foo | awk '{ print $3 }') = scripts/foo.{$extensions}
end
test "$TESTNAME - Move <plugin>/*.{$extensions} TO functions/*"
(__fisher_plugin_walk bar $path/bar | awk '{ print $3 }') = functions/bar.{$extensions}
end

View File

@ -20,8 +20,6 @@
# ├── fish_right_prompt.fish Theme/Prompt File *
# ├── fish_user_key_bindings.fish Bindings File Fisherman
# ├── quux.awk Script File Fisherman OMF
# ├── scripts Script Files Fisherman
# │   └── norf.py
# ├── functions Shared Functions *
# │   ├── foobar-baz.fish
# │   ├── foobar.awk
@ -99,7 +97,6 @@
# -- foobar/... functions/foobar.pl
# -- foobar/... functions/foobar.awk
# -- foobar/... functions/foobar.sed
# -- foobar/... scripts/norf.py
# -- foobar/... functions/quux.awk
# --man foobar/... man/man1/foobar.1
# --man foobar/... man/man2/foobar.2

View File

@ -37,10 +37,6 @@ test "$TESTNAME - Remove plugin key bindings from key_bindings.fish"
-z (cat $path/config/key_bindings.fish | xargs)
end
test "$TESTNAME - Remove plugin scripts from \$fisher_config/scripts"
! -e $path/config/scripts/norf.py
end
test "$TESTNAME - Remove plugin \$fisher_config/completions"
! -e $path/config/completions/foobar.fish
end