Skip to content
/ shell Public

终端 神农架 plugin manager of shell script

Notifications You must be signed in to change notification settings

shylinux/shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shell plugin manager

Abort

plug.sh allows you to...

  • keep track of and configure your plugins right in the .ish/pluged/
  • install configured plugins (a.k.a. scripts/bundle)
  • update configured plugins
  • search by name all available scripts
  • clean unused plugins up

plug.sh automatically...

  • clone the repos if the plugins don't exists
  • load the script if the plugins don't source
  • manages the runtime path of your installed scripts
  • regenerates help tags after installing and updating

Quick Start

1. Set up plug.sh

git clone https://github.com/shylinux/shell.git ~/.ish

2. Configure Plugins:

Put this at the bottom of your .bashrc to use plug.sh.

if [ -f ~/.ish/plug.sh ] && source ~/.ish/plug.sh; then
    require conf.sh
    require as miss github.com/shylinux/shell misc/miss/miss.sh
   # ... add other plugins
fi

3. Use Plugins:

use by auto load

$ ish github.com/shylinux/shell/base.cli.os_os_system
GNU/Linux

use by manual load

$ require as demo github.com/shylinux/shell base/cli/os.sh

after load os.sh, you call all the function directly

$ ish_demo_os_system
GNU/Linux

$ ish_demo_os_kernel
Linux

Create Plugins:

add plugin

if the plugin named demo add the code to the file $ISH_PATH/demo/demo.sh

ish set repos "github.com/xxx/xxx"
ish set owner "[email protected]"
ish set product "plugin demo"
ish set version "v0.0.1"

${ISH_CTX_SCRIPT}_info() { ish mod $0
    echo "repos: $(ish get repos)"
    echo "owner: $(ish get owner)"
    echo "product: $(ish get product)"
    echo "version: $(ish get version)"
}
${ISH_CTX_SCRIPT}_help() { ish mod $0
    echo "usage: ish mod/file.fun arg..."
}
${ISH_CTX_SCRIPT}_init() { ish mod $0
    pwd
}

use plugin

use the new plugin

$ ish demo/demo_info
repos: github.com/xxx/demo
owner: [email protected]
product: plugin demo
version: v0.0.1

share plugin

if you create git repos, and push it to the github, use by long name

$ ish github.com/xxx/demo/demo.info
repos: github.com/xxx/xxx
owner: [email protected]
product: plugin demo
version: v0.0.1

About

终端 神农架 plugin manager of shell script

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages