Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
abs3nt | 8cf145955c | |
abs3nt | 62c1714958 | |
abs3nt | 49effe24b4 | |
abs3nt | 0f19f085ff | |
abs3nt | 7fa2e67a89 | |
abs3nt | 0a0c88f25d | |
abs3nt | 4992e63edb | |
abs3nt | 32d1074fd9 | |
abs3nt | 8f9ff1dada | |
abs3nt | ec35355705 | |
abs3nt | 40203011d5 | |
abs3nt | 2d893b57c2 | |
abs3nt | 4e854075df | |
abs3nt | 0e454d971d |
|
@ -25,6 +25,7 @@ _testmain.go
|
|||
*.exe
|
||||
*.test
|
||||
*.prof
|
||||
/assets/
|
||||
|
||||
.glide
|
||||
.idea
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
gitea_urls:
|
||||
api: https://gitea.asdf.cafe/api/v1
|
||||
download: https://gitea.asdf.cafe
|
||||
api: https://git.asdf.cafe/api/v1
|
||||
download: https://git.asdf.cafe
|
||||
skip_tls_verify: false
|
||||
|
||||
before:
|
||||
|
|
13
Makefile
13
Makefile
|
@ -5,6 +5,12 @@ ${pkgname}: $(shell find . -name '*.go')
|
|||
mkdir -p bin
|
||||
go build -o bin/${pkgname} .
|
||||
|
||||
decode:
|
||||
go run ./hack/unpack/main.go
|
||||
|
||||
pack-site:
|
||||
go-bindata -pkg haunt -o src/haunt/bindata.go -fs assets/...
|
||||
|
||||
completions:
|
||||
mkdir -p completions
|
||||
./bin/${pkgname} completion zsh > completions/_${pkgname}
|
||||
|
@ -18,17 +24,18 @@ tidy:
|
|||
go mod tidy
|
||||
|
||||
clean:
|
||||
rm -f bin
|
||||
rm -rf bin
|
||||
rm -rf completions
|
||||
rm -rf assets
|
||||
|
||||
uninstall:
|
||||
rm -f /usr/bin/${pkgname}
|
||||
rm -f /usr/local/bin/${pkgname}
|
||||
rm -f /usr/share/zsh/site-functions/_${pkgname}
|
||||
rm -f /usr/share/bash-completion/completions/${pkgname}
|
||||
rm -f /usr/share/fish/vendor_completions.d/${pkgname}.fish
|
||||
|
||||
install:
|
||||
cp bin/${pkgname} /usr/bin
|
||||
cp bin/${pkgname} /usr/local/bin
|
||||
bin/${pkgname} completion zsh > /usr/share/zsh/site-functions/_${pkgname}
|
||||
bin/${pkgname} completion bash > /usr/share/bash-completion/completions/${pkgname}
|
||||
bin/${pkgname} completion fish > /usr/share/fish/vendor_completions.d/${pkgname}.fish
|
||||
|
|
17
README.md
17
README.md
|
@ -12,6 +12,12 @@ cd haunt
|
|||
make build && sudo make install
|
||||
```
|
||||
|
||||
#### aur
|
||||
|
||||
```
|
||||
yay -S haunt-go-git
|
||||
```
|
||||
|
||||
### Completions
|
||||
completions will be automatically installed if you used the Makefile, if you did not you can generate completions with `haunt completion [bash/fish/powershell/zsh]`
|
||||
|
||||
|
@ -59,6 +65,7 @@ Possible flags are:
|
|||
-t, --test Enable go test
|
||||
-v, --vet Enable go vet
|
||||
|
||||
|
||||
### Remove Command
|
||||
Remove a project by its name
|
||||
|
||||
|
@ -83,7 +90,7 @@ Remove a project by its name
|
|||
schema:
|
||||
- name: coin
|
||||
path: cmd/coin // project path
|
||||
env: // env variables available at startup
|
||||
env: // env variables for run
|
||||
test: test
|
||||
myvar: value
|
||||
commands: // go commands supported
|
||||
|
@ -124,12 +131,20 @@ Remove a project by its name
|
|||
command: echo before global
|
||||
global: true
|
||||
output: true
|
||||
env: // env variables per script
|
||||
test: test
|
||||
myvar: value
|
||||
- type: before
|
||||
command: echo before change
|
||||
output: true
|
||||
env: // env variables per script
|
||||
test: othertest
|
||||
myvar: othervalue
|
||||
- type: after
|
||||
command: echo after change
|
||||
output: true
|
||||
env: // env variables per script
|
||||
key: 1
|
||||
- type: after
|
||||
command: echo after global
|
||||
global: true
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
<div ui-view="content" style="width:100%;" ng-if="!socket.err"></div>
|
||||
<div ui-view="content" style="width:100%;" ng-if="socket.err" layout="row" layout-align="center stretch">
|
||||
<div flex="100" layout="row" layout-align="center center" id="err" layout-wrap="layout-wrap">
|
||||
<div flex="100"><img src="/assets/img/logo.png" /></div>
|
||||
<div flex="100" layout-padding="layout-padding">websocket not found</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,102 +0,0 @@
|
|||
<md-content layout="row" layout-wrap="layout-wrap" flex="100" layout-align="start start"><md-toolbar flex="100"
|
||||
id="header" layout="row" layout-wrap="layout-wrap">
|
||||
<div class="menu" layout="row" layout-align="center center" ng-click="rotate()"><md-icon class="transition"
|
||||
md-svg-src="{{icon}}" ng-class="{ 'rotate': open}"></md-icon></div>
|
||||
<div class="navbar" layout="row" layout-align="space-between center" flex="flex">
|
||||
<div flex="50" layout="row" layout-align="start center"><img class="logo" src="/assets/img/logo.png" />
|
||||
<div>
|
||||
<div class="title">{{current.name}}</div>
|
||||
<div class="circle" ng-if="socket.status"></div>
|
||||
<div class="circle-red" ng-if="!socket.status"></div>
|
||||
<div class="status">Active</div>
|
||||
</div>
|
||||
</div>
|
||||
<div flex="50" layout="row" layout-align="end center"><md-button class="md-icon-button md-primary"
|
||||
aria-label="settings"><md-tooltip md-direction="left">Coming soon</md-tooltip><img class="settings"
|
||||
src="/assets/img/svg/ic_settings_black_48px.svg" /></md-button></div>
|
||||
</div>
|
||||
</md-toolbar><md-content flex="100" id="content" layout="start stretch"><md-sidenav class="md-sidenav-left transition"
|
||||
layout="row" layout-wrap="layout-wrap" layout-align="start stretch" md-component-id="left"
|
||||
md-disable-backdrop="md-disable-backdrop" md-is-locked-open="open">
|
||||
<div class="fade-out" flex="100" layout="column" layout-wrap="layout-wrap" layou-align="center space-between"
|
||||
ng-hide="!open">
|
||||
<div flex="85" layout="row" layout-wrap="layout-wrap" layout-align="start start">
|
||||
<!--div(flex=100 layout="row" layout-wrap class="menu")--><!-- div(flex=100 class="title back")--><!-- md-button(class="md-icon-button md-primary" aria-label="settings")--><!-- img(src="/assets/img/svg/ic_arrow_back_black_48px.svg" class="back-ico")--><!-- span Projects-->
|
||||
<div class="side"><md-button class="md-icon-button md-primary fade-out" aria-label="settings"
|
||||
ng-click="back()" ng-hide="list"><md-icon
|
||||
md-svg-src="/assets/img/svg/ic_arrow_back_black_48px.svg"></md-icon></md-button></div>
|
||||
<div class="menu" flex="flex" layout="row" layout-wrap="layout-wrap" ng-hide="list"
|
||||
ng-class="{'fade-out':!list}">
|
||||
<div class="title" flex="100">Projects</div>
|
||||
<div class="project" flex="100" ng-click="change(1)" ng-class="{'active': select == 1}">All</div>
|
||||
<div class="project" flex="100" ng-click="change(2)" ng-class="{'active': select == 2}">Logs</div>
|
||||
<div class="project" flex="100" ng-click="change(3)" ng-class="{'active': select == 3}">Errors</div>
|
||||
<div class="project" flex="100" ng-click="change(4)" ng-class="{'active': select == 4}">Outputs</div>
|
||||
</div>
|
||||
<div class="menu" flex="flex" layout="row" layout-wrap="layout-wrap" ng-hide="!list">
|
||||
<div class="title" flex="100">Projects</div>
|
||||
<div class="project" flex="100" ng-repeat="item in socket.data.schema"
|
||||
ng-class="{'active':item.name == current.name}" ng-click="collapse(item.name)">{{item.name}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="version" flex="15" layout="row" layout-wrap="layout-wrap" layout-align="start center">
|
||||
<div flex="100"><a href="https://github.com/abs3ntdev/haunt">Help & Documentation</a></div>
|
||||
<div flex="100" layout-padding="layout-padding"><a
|
||||
href="https://github.com/abs3ntdev/haunt/blob/master/README.md">Haunt</a></div>
|
||||
<div flex="100"><a href="https://github.com/abs3ntdev/haunt" target="_blank"><md-button
|
||||
class="md-icon-button md-primary" aria-label="settings"><md-icon
|
||||
md-svg-src="/assets/img/svg/github-logo.svg"></md-icon></md-button></a></div>
|
||||
</div>
|
||||
</div>
|
||||
</md-sidenav>
|
||||
<div class="tabs" flex="100" layout="row" layout-wrap="layout-wrap" layout-align="space-around stretch"
|
||||
layout-padding="layout-padding">
|
||||
<div class="tab" flex="flex" layout="row" layout-wrap="layout-wrap" layout-align="start start"
|
||||
ng-hide="select != 1 && select != 2">
|
||||
<div class="name" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row">
|
||||
<div>Logs</div>
|
||||
</div>
|
||||
<div class="streams" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div class="item" flex="100" layout="row" ng-repeat="out in current.buffer.stdLog | orderBy:'-time'">
|
||||
<div class="cap" flex="80">{{out.text}}</div>
|
||||
<div flex="20" layout="row" layout-align="end start">{{out.time | date: 'shortTime'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab" flex="flex" layout="row" layout-wrap="layout-wrap" layout-align="start start"
|
||||
ng-hide="select != 1 && select != 3">
|
||||
<div class="name" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row">
|
||||
<div>Errors</div>
|
||||
<div class="err" ng-if="current.buffer.stdErr.length > 0">{{current.buffer.stdErr.length}}</div>
|
||||
</div>
|
||||
<div class="streams" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div class="item" flex="100" layout-wrap="layout-wrap" layout="row"
|
||||
ng-repeat="out in current.buffer.stdErr | orderBy:'-time'">
|
||||
<div class="cap" flex="80"><span>{{out.type}}</span><br /><span>{{out.text}}</span></div>
|
||||
<div flex="20" layout="row" layout-align="end start">{{out.time | date: 'shortTime'}}</div>
|
||||
<div flex="100" ng-if="out.stream">
|
||||
<div>{{out.stream}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab" flex="flex" layout="row" layout-wrap="layout-wrap" layout-align="start start"
|
||||
ng-hide="select != 1 && select != 4">
|
||||
<div class="name" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row">
|
||||
<div>Outputs</div>
|
||||
</div>
|
||||
<div class="streams" flex="100" layout="row" layout-wrap="layout-wrap">
|
||||
<div class="item" flex="100" layout="row" ng-repeat="out in current.buffer.stdOut | orderBy:'-time'">
|
||||
<div class="cap" flex="80">{{out.text}}</div>
|
||||
<div flex="20" layout="row" layout-align="end start">{{out.time | date: 'shortTime'}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</md-content></md-content>
|
|
@ -1,141 +0,0 @@
|
|||
<div layout="row" flex="100" layout-wrap="layout-wrap" id="projects"><md-whiteframe class="md-whiteframe-2dp box scroll"
|
||||
flex="100" layout="row" layout-align="start start" layout-wrap="layout-wrap"><md-toolbar class="bar bgg" flex="100"
|
||||
layout="row" layout-align="space-between center">
|
||||
<div class="left" flex="flex"><md-button class="md-icon-button hov no-margin"
|
||||
ui-sref="app.project({name: current.name})"><md-icon
|
||||
md-svg-src="/assets/img/svg/backspace.svg"></md-icon></md-button></div>
|
||||
<div class="right" flex="flex" layout-padding="layout-padding">{{current.name || '-'}}</div>
|
||||
</md-toolbar><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding" layout-align="center center">
|
||||
<div class="field" flex="50">working path</div>
|
||||
<div class="value text" flex="50">{{current.path || '-'}}</div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding" layout-align="center center">
|
||||
<div class="field" flex="50">params</div>
|
||||
<div class="value text" flex="50"><span ng-if="!current.args">-</span><span
|
||||
ng-repeat="param in current.args">{{param}}{{$last ? '' : ', '}}</span></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding" layout-align="center center">
|
||||
<div class="field" flex="50">Environment</div>
|
||||
<div class="value text" flex="50"><span ng-if="!current.environment">-</span><span
|
||||
ng-repeat="env in current.environment">{{env}}{{$last ? '' : ', '}}</span></div>
|
||||
</div>
|
||||
</md-list-item><!--section--><md-list-item class="paragraph" layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field title" flex="100" layout-padding="layout-padding">Settings</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go run</div>
|
||||
<div class="value" flex="50" ng-class="{ 'enabled': current.commands.run, 'disabled': !current.commands.run }"
|
||||
layout="row" layout-align="space-between center">
|
||||
<div>{{current.commands.run ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.run"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go build</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.build.status, 'disabled': !current.commands.build.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.build.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.build.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go install</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.install.status, 'disabled': !current.commands.install.status }"
|
||||
layout="row" layout-align="space-between center">
|
||||
<div>{{current.commands.install.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.install.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go fmt</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.fmt.status, 'disabled': !current.commands.fmt.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.fmt.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.fmt.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go vet</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.vet.status, 'disabled': !current.commands.vet.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.vet.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.vet.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go test</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.test.status, 'disabled': !current.commands.test.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.test.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.test.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go generate</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.generate.status, 'disabled': !current.commands.generate.status }"
|
||||
layout="row" layout-align="space-between center">
|
||||
<div>{{current.commands.generate.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.generate.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go fix</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.fix.status, 'disabled': !current.commands.fix.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.fix.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.fix.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">go clean</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.commands.clean.status, 'disabled': !current.commands.clean.status }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.commands.clean.status ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.commands.clean.status"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item><!--section--><md-list-item class="paragraph" layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field title" flex="100" layout-padding="layout-padding">watcher</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding">
|
||||
<div class="field" flex="50">Folders to watch</div>
|
||||
<div class="value text" flex="50"><span ng-repeat="path in current.watcher.paths">{{path}}{{$last ? '' : ',
|
||||
'}}</span></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding">
|
||||
<div class="field" flex="50">file extensions to watch</div>
|
||||
<div class="value text" flex="50"><span ng-repeat="ext in current.watcher.extensions">{{ext}}{{$last ? '' : ',
|
||||
'}}</span></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding">
|
||||
<div class="field" flex="50">ignored folders</div>
|
||||
<div class="value text" flex="50"><span ng-repeat="dir in current.watcher.ignored_paths">{{dir}}{{$last ? '' :
|
||||
', '}}</span></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div flex="100" layout="row" layout-padding="layout-padding">
|
||||
<div class="field" flex="50">After/Before commands</div>
|
||||
<div class="value text" flex="50"><span>{{current.watcher.scripts.length || '-'}}</span></div>
|
||||
</div>
|
||||
</md-list-item><md-list-item layout="row" flex="100" layout-wrap="layout-wrap">
|
||||
<div class="field" flex="50">file preview</div>
|
||||
<div class="value" flex="50"
|
||||
ng-class="{ 'enabled': current.watcher.preview, 'disabled': !current.watcher.preview }" layout="row"
|
||||
layout-align="space-between center">
|
||||
<div>{{current.watcher.preview ? 'Enabled' : 'Disabled' }}</div>
|
||||
<div><md-switch class="md-warn md-hue-2" ng-change="sync()" ng-model="current.watcher.preview"
|
||||
aria-label="switch"></md-switch></div>
|
||||
</div>
|
||||
</md-list-item></md-whiteframe></div>
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Before Width: | Height: | Size: 6.7 KiB |
|
@ -1 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" width="438.549" height="438.549" viewBox="0 0 438.549 438.549"><path d="M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 0 1-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"/></svg>
|
Before Width: | Height: | Size: 2.2 KiB |
|
@ -1 +0,0 @@
|
|||
<svg height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path fill="#fff" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>
|
Before Width: | Height: | Size: 210 B |
|
@ -1 +0,0 @@
|
|||
<svg fill="#FFF" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/><path d="M0 0h24v24H0z" fill="none"/></svg>
|
Before Width: | Height: | Size: 251 B |
|
@ -1 +0,0 @@
|
|||
<svg fill="#FFF" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z"/></svg>
|
Before Width: | Height: | Size: 195 B |
|
@ -1 +0,0 @@
|
|||
<svg height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path fill="#8ca0b3" d="M19.43 12.98c.04-.32.07-.64.07-.98s-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65A.488.488 0 0 0 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.23-.09-.49 0-.61.22l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98s.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.12.22.39.3.61.22l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23.09.49 0 .61-.22l2-3.46c.12-.22.07-.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z"/></svg>
|
Before Width: | Height: | Size: 821 B |
92136
assets/assets/js/all.js
92136
assets/assets/js/all.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,24 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html ng-app="haunt">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900" rel="stylesheet">
|
||||
<link rel="icon" href="/assets/img/logo.png"><!-- bower:css -->
|
||||
<!-- endinject -->
|
||||
<!-- inject:css -->
|
||||
<link rel="stylesheet" href="/assets/css/app.css">
|
||||
<!-- endinject -->
|
||||
<title>Haunt</title>
|
||||
</head>
|
||||
|
||||
<body ui-view layout="row" layout-align="start stretch"><!-- bower:js -->
|
||||
<!-- endinject -->
|
||||
<!-- inject:js -->
|
||||
<script src="/assets/js/all.min.js"></script>
|
||||
<!-- endinject -->
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -13,10 +13,11 @@ import (
|
|||
var addConfig config.Flags
|
||||
|
||||
var addCmd = &cobra.Command{
|
||||
Use: "add",
|
||||
Short: "Adds a project by name",
|
||||
Long: "Adds a project by name, if path is provided it will use 'cmd/name', all flags provided will be saved in the config file. By default go install and go run will be ran",
|
||||
Args: cobra.MatchAll(cobra.ExactArgs(1)),
|
||||
Use: "add",
|
||||
Aliases: []string{"a", "create", "new"},
|
||||
Short: "Adds a project by name",
|
||||
Long: "Adds a project by name, if path is provided it will use 'cmd/name', all flags provided will be saved in the config file. By default go install and go run will be ran",
|
||||
Args: cobra.MatchAll(cobra.ExactArgs(1)),
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) >= 1 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
|
|
|
@ -9,9 +9,10 @@ import (
|
|||
|
||||
// cleanCmd represents the clean command
|
||||
var cleanCmd = &cobra.Command{
|
||||
Use: "clean",
|
||||
Short: "Deletes the haunt config file",
|
||||
RunE: clean,
|
||||
Use: "clean",
|
||||
Aliases: []string{"c"},
|
||||
Short: "Deletes the haunt config file",
|
||||
RunE: clean,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -12,10 +12,11 @@ import (
|
|||
|
||||
// initCmd represents the init command
|
||||
var initCmd = &cobra.Command{
|
||||
Use: "init",
|
||||
Short: "Generates a haunt config file using sane defaults",
|
||||
Long: "Generates a haunt config file using sane defaults, haunt will look for a main.go file and any directories inside the relative path 'cmd' and add them all as projects",
|
||||
RunE: defaultConfig,
|
||||
Use: "init",
|
||||
Aliases: []string{"i"},
|
||||
Short: "Generates a haunt config file using sane defaults",
|
||||
Long: "Generates a haunt config file using sane defaults, haunt will look for a main.go file and any directories inside the relative path 'cmd' and add them all as projects",
|
||||
RunE: defaultConfig,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -9,9 +9,10 @@ import (
|
|||
)
|
||||
|
||||
var removeCmd = &cobra.Command{
|
||||
Use: "remove [names]",
|
||||
Short: "Removes all projects by name from config file",
|
||||
Args: cobra.MatchAll(cobra.MinimumNArgs(1), cobra.OnlyValidArgs),
|
||||
Use: "remove [names]",
|
||||
Aliases: []string{"delete", "r"},
|
||||
Short: "Removes all projects by name from config file",
|
||||
Args: cobra.MatchAll(cobra.MinimumNArgs(1), cobra.OnlyValidArgs),
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return getProjectNames(toComplete), cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
|
|
35
cmd/run.go
35
cmd/run.go
|
@ -1,25 +1,28 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/abs3ntdev/haunt/src/haunt"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var runCmd = &cobra.Command{
|
||||
Use: "run",
|
||||
Short: "run haunt, optionally provide the name of projects to only run those otherwise will run all configured projects",
|
||||
Args: cobra.MatchAll(cobra.OnlyValidArgs),
|
||||
var startCmd = &cobra.Command{
|
||||
Use: "start",
|
||||
Aliases: []string{"s", "run"},
|
||||
Short: "run haunt, optionally provide the name of projects to only run those otherwise will run all configured projects",
|
||||
Args: cobra.MatchAll(cobra.OnlyValidArgs),
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
return getProjectNamesToRun(toComplete), cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
RunE: run,
|
||||
RunE: start,
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(runCmd)
|
||||
rootCmd.AddCommand(startCmd)
|
||||
}
|
||||
|
||||
func getProjectNamesToRun(input string) []string {
|
||||
|
@ -39,13 +42,25 @@ func getProjectNamesToRun(input string) []string {
|
|||
}
|
||||
|
||||
// haunt workflow
|
||||
func run(cmd *cobra.Command, args []string) (err error) {
|
||||
func start(cmd *cobra.Command, args []string) (err error) {
|
||||
h := haunt.NewHaunt()
|
||||
|
||||
// read a config if exist
|
||||
err = h.Settings.Read(&h)
|
||||
if err != nil {
|
||||
return err
|
||||
if os.IsNotExist(err) {
|
||||
log.Println(h.Prefix("No config file found, initializing one for you"))
|
||||
err = defaultConfig(cmd, args)
|
||||
if err != nil {
|
||||
log.Println(h.Prefix("Failed to generate default config: " + err.Error()))
|
||||
}
|
||||
err = h.Settings.Read(&h)
|
||||
if err != nil {
|
||||
return fmt.Errorf(h.Prefix("Failed to read config file: " + err.Error()))
|
||||
}
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if len(args) >= 1 {
|
||||
// filter by name flag if exist
|
||||
|
@ -75,6 +90,6 @@ func run(cmd *cobra.Command, args []string) (err error) {
|
|||
}
|
||||
}
|
||||
|
||||
// run workflow
|
||||
return h.Run()
|
||||
// start workflow
|
||||
return h.Start()
|
||||
}
|
||||
|
|
|
@ -7,19 +7,13 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var Version = "v0.2.5"
|
||||
var Version = "v0.2.11"
|
||||
|
||||
// versionCmd represents the version command
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "A brief description of your command",
|
||||
Long: `A longer description that spans multiple lines and likely contains examples
|
||||
and usage of using your command. For example:
|
||||
|
||||
Cobra is a CLI library for Go that empowers applications.
|
||||
This application is a tool to generate the needed files
|
||||
to quickly create a Cobra application.`,
|
||||
Run: version,
|
||||
Short: "Prints current verison",
|
||||
Run: version,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/abs3ntdev/haunt/src/haunt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
names := haunt.AssetNames()
|
||||
fmt.Println("Assets in bindata:")
|
||||
fmt.Println(names)
|
||||
|
||||
wd := "assets"
|
||||
for i, v := range names {
|
||||
fmt.Printf("Restoring asset [%v] [%s]\n", i, v)
|
||||
err := haunt.RestoreAsset(wd, v)
|
||||
if err != nil {
|
||||
fmt.Println("Failed to restore", v)
|
||||
}
|
||||
}
|
||||
}
|
|
@ -145,8 +145,8 @@ func (h *Haunt) Stop() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// Run haunt workflow
|
||||
func (h *Haunt) Run() error {
|
||||
// Start haunt workflow
|
||||
func (h *Haunt) Start() error {
|
||||
if len(h.Projects) > 0 {
|
||||
var wg sync.WaitGroup
|
||||
wg.Add(len(h.Projects))
|
||||
|
|
|
@ -41,11 +41,12 @@ type Ignore struct {
|
|||
|
||||
// Command fields
|
||||
type Command struct {
|
||||
Cmd string `yaml:"command" json:"command"`
|
||||
Type string `yaml:"type" json:"type"`
|
||||
Path string `yaml:"path,omitempty" json:"path,omitempty"`
|
||||
Global bool `yaml:"global,omitempty" json:"global,omitempty"`
|
||||
Output bool `yaml:"output,omitempty" json:"output,omitempty"`
|
||||
Cmd string `yaml:"command" json:"command"`
|
||||
Type string `yaml:"type" json:"type"`
|
||||
Env map[string]string `yaml:"env,omitempty" json:"env,omitempty"`
|
||||
Path string `yaml:"path,omitempty" json:"path,omitempty"`
|
||||
Global bool `yaml:"global,omitempty" json:"global,omitempty"`
|
||||
Output bool `yaml:"output,omitempty" json:"output,omitempty"`
|
||||
}
|
||||
|
||||
// Project info
|
||||
|
@ -542,7 +543,7 @@ func (p *Project) stamp(t string, o BufferOut, msg string, stream string) {
|
|||
case "out":
|
||||
p.Buffer.StdOut = append(p.Buffer.StdOut, o)
|
||||
if p.parent.Settings.Files.Outputs.Status {
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Files.Outputs.Name)
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Outputs.Name)
|
||||
if _, err := f.WriteString(strings.Join(content, " ")); err != nil {
|
||||
p.parent.Settings.Fatal(err, "")
|
||||
}
|
||||
|
@ -550,7 +551,7 @@ func (p *Project) stamp(t string, o BufferOut, msg string, stream string) {
|
|||
case "log":
|
||||
p.Buffer.StdLog = append(p.Buffer.StdLog, o)
|
||||
if p.parent.Settings.Files.Logs.Status {
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Files.Logs.Name)
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Logs.Name)
|
||||
if _, err := f.WriteString(strings.Join(content, " ")); err != nil {
|
||||
p.parent.Settings.Fatal(err, "")
|
||||
}
|
||||
|
@ -558,7 +559,7 @@ func (p *Project) stamp(t string, o BufferOut, msg string, stream string) {
|
|||
case "error":
|
||||
p.Buffer.StdErr = append(p.Buffer.StdErr, o)
|
||||
if p.parent.Settings.Files.Errors.Status {
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Files.Errors.Name)
|
||||
f := p.parent.Settings.Create(p.Path, p.parent.Settings.Errors.Name)
|
||||
if _, err := f.WriteString(strings.Join(content, " ")); err != nil {
|
||||
p.parent.Settings.Fatal(err, "")
|
||||
}
|
||||
|
@ -577,7 +578,14 @@ func (p *Project) stamp(t string, o BufferOut, msg string, stream string) {
|
|||
|
||||
func (p Project) buildEnvs() (envs []string) {
|
||||
for k, v := range p.Env {
|
||||
envs = append(envs, fmt.Sprintf("%s=%s", strings.Replace(k, "=", "", -1), v))
|
||||
envs = append(envs, fmt.Sprintf("%s=%s", strings.ReplaceAll(k, "=", ""), v))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (c Command) buildEnvs() (envs []string) {
|
||||
for k, v := range c.Env {
|
||||
envs = append(envs, fmt.Sprintf("%s=%s", strings.ReplaceAll(k, "=", ""), v))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -715,6 +723,10 @@ func (c *Command) exec(base string, stop <-chan bool) (response Response) {
|
|||
done := make(chan error)
|
||||
args := strings.Split(strings.Replace(strings.Replace(c.Cmd, "'", "", -1), "\"", "", -1), " ")
|
||||
ex := exec.Command(args[0], args[1:]...)
|
||||
appendEnvs := c.buildEnvs()
|
||||
if len(appendEnvs) > 0 {
|
||||
ex.Env = append(ex.Env, appendEnvs...)
|
||||
}
|
||||
ex.Dir = base
|
||||
// make cmd path
|
||||
if c.Path != "" {
|
||||
|
|
Loading…
Reference in New Issue