Dev
Lightweight Bash Scripts Manager
Install / Use
/learn @liudng/DevREADME
dev - Lightweight Bash Scripts Manager
For large and complex software projects need to setup the development environment, including software installation dependents, clone source code repository, manage a large number of scripts, custom configuration files, and so on.
The goal of dev is to make these things easier.
This documentation assumes you are already familiar with Bash. If you do not know anything about Bash, consider familiarizing yourself with the general terminology and features of Bash before continuing.
Featues
- Writen in pure bash.
- Modular.
- Lightweight.
Installation
Clone the dev repository to a local directory:
git clone git@github.com:liudng/dev.git ~/dev
Add ~/dev/bin to the PATH variable:
echo "export PATH=$PATH:~/dev/bin" >> ~/.bashrc
Or link ~/dev/bin/dev.bash to a PATH directory:
ln -s ~/dev/bin/dev.bash ~/.local/bin/dev
ln -s ~/dev/bin/dev-bootstrap.bash ~/.local/bin/dev-bootstrap.bash
Create a configuration file:
cp ~/dev/etc/dev.conf.example ~/dev/etc/dev.conf
If you want to use the command auto completion, run the following command:
cat ~/dev/share/completion.bash >> ~/.bash_completion
The installation is complete, enter dev --help at the command line to see how to use it.
Usage
dev [--sudo] [--trace] [--verbose] <cmd-file> <cmd-function> [arguments...]
dev [--help] [--version]
dev's custom commands are saved in the cmd directory, and the file extension
must be .bash, In the help topic it is named cmd-file. In each command
file, cmd-function is prefixed with cmd_.
Example
Type the folloing command:
dev examples/example helloworld
Output:
Hello world!
Custom Command Example
Create a new command to copy the following text to the file ~/dev/cmd/demo.bash:
cmd_helloworld() {
echo "Hello world!"
}
And then type the following command to run:
dev demo helloworld
Output:
Hello world!
In the above command, demo is cmd-file. helloworld is cmd-function.
You can save all project-related commands in the cmd directory.
More examples, see the files in th cmd directory.
The Library Scripts
Import a library script to current command file, Add following line to file start:
dev_import dev file
It will load the script file from dev project's lib/file.bash.
Global Variables Reference
$dev_global_projectThe project name.$dev_global_baseThe project base directory.
Global Functions Reference
dev_importImport a library file to current file.dev_run
Multi-project
Using dev to manage multiple projects is very easy.
...
More project examples, see the sys project.
Copyright
Copyright 2018 The dev Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Related Skills
tmux
352.0kRemote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
diffs
352.0kUse the diffs tool to produce real, shareable diffs (viewer URL, file artifact, or both) instead of manual edit summaries.
blogwatcher
352.0kMonitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.
prd
Raito Bitcoin ZK client web portal.
