Skip to content
This repository was archived by the owner on Apr 21, 2020. It is now read-only.

Commit 9df20a9

Browse files
committed
New: Add devcontrol installer
1 parent 83f1d3a commit 9df20a9

2 files changed

Lines changed: 35 additions & 6 deletions

File tree

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,19 @@ You may be tired of executing the same sentences in order, over and over again,
88

99
The `devcontrol` script can help by calling your set of scripts that automate these tasks, such as starting or stopping services, loading initial data, putting everything together in a single dynamic management interface and allowing you to keep the focus on your development work.
1010

11-
## Usage
11+
## Installation
1212

13-
The script assumes that you are working with a `git` repository.
13+
Open a console and execute `curl https://raw.githubusercontent.com/teecke/devcontrol/master/install.sh | sudo bash`. The `devcontrol` script will install in your `/usr/local/bin` directory.
1414

15-
1. Put the `devcontrol.sh` script somewhere in your path an make it executable. I suggest you to put it under `/usr/local/bin` naming it`devcontrol`, or put in a directory of your project in `bin/devcontrol.sh`.
16-
2. Create a directory called `devcontrol/actions` im the root directory of your `git` repository and put your action scripts (one bash script file per action) within.
17-
3. Optionally, create another directory called `devcontrol/global` and put a bash script called `startup.sh` with your initialization variables and global functions.
18-
4. Execute the `devcontrol` script in the root folder of your project.
15+
## Create actions
16+
17+
You can add actions to your repository. Simply put one or more bash script files under the `devcontrol/actions` directory of your `git` repository with the `.sh` extension. Then execute `devcontrol` at the root of the repository.
18+
19+
In details:
20+
21+
1. Create a directory called `devcontrol/actions` at the root directory of your `git` repository and put whithin your action scripts (one bash script file per action, with the `.sh` extension).
22+
2. Optionally, create another directory called `devcontrol/global` and put a bash script called `startup.sh` with your initialization variables and global functions.
23+
3. Execute the `devcontrol` script in the root folder of your project.
1924

2025
The `devcontrol` script will collect the whole of your action scripts and put enable you to execute as parametrized options of the `devcontrol` script.
2126

install.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# Init
4+
SOURCE="https://raw.githubusercontent.com/teecke/devcontrol/master/devcontrol.sh"
5+
TARGET="/usr/local/bin/devcontrol"
6+
7+
# Check
8+
if [ "$EUID" -ne 0 ]
9+
then echo "Please run as root"
10+
exit
11+
fi
12+
if [ -f "${TARGET}" ]; then
13+
echo "devcontrol is already installed in ${TARGET}. Aborting"
14+
exit 1
15+
fi
16+
17+
# Install
18+
curl -s ${SOURCE} -o ${TARGET}
19+
if [ $? -eq 0 ]; then
20+
chmod 777 /usr/local/bin/devcontrol
21+
echo "devcontrol installed in ${TARGET}"
22+
else
23+
echo "Error installing devcontrol. Try again later"
24+
fi

0 commit comments

Comments
 (0)