https://github.com/invrs/basher
Run any command or script anywhere, in any order
https://github.com/invrs/basher
Last synced: 10 months ago
JSON representation
Run any command or script anywhere, in any order
- Host: GitHub
- URL: https://github.com/invrs/basher
- Owner: invrs
- Created: 2016-01-19T03:28:54.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-02-03T08:22:05.000Z (over 10 years ago)
- Last Synced: 2025-09-20T22:53:52.562Z (10 months ago)
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basher.js [](https://travis-ci.org/invrs/basher)
Run any command or shell script anywhere, in any order.
## Basic "hello" task
**`bin/run`**:
```js
#!/usr/bin/env node
require("../lib/runner")().run()
```
**`lib/runner.js`**:
```js
import { command } from "basher"
class Runner {
constructor(state) {
this.state({
task: state.options._[0],
tasks: this.commands
})
}
help(state) {
console.log(`Usage: ./bin/run [task]`)
}
run(state) {
return this.tasks(state)
}
}
export default command(Runner).include(__dirname)
```
**`lib/commands/hello.js`**:
```js
import { command } from "basher"
export default command(class {
description() {
return "hello description"
}
help(state) {
console.log(`Usage: ./bin/run hello`)
}
run() {
console.log("hello!")
}
})
```