├── .dockerignore ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── BUG_REPORT.md │ └── FEATURE_REQUEST.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── release.yml │ └── test.yml ├── .gitignore ├── .goreleaser.yml ├── LICENSE ├── Makefile ├── README.md ├── cmd ├── check.go ├── completion.go ├── describe.go ├── describe_projects.go ├── describe_tasks.go ├── edit.go ├── edit_project.go ├── edit_task.go ├── exec.go ├── gen.go ├── gen_docs.go ├── init.go ├── list.go ├── list_projects.go ├── list_tags.go ├── list_tasks.go ├── root.go ├── run.go ├── sync.go └── tui.go ├── core ├── config.man ├── dao │ ├── common.go │ ├── common_test.go │ ├── config.go │ ├── config_test.go │ ├── import.go │ ├── project.go │ ├── project_test.go │ ├── spec.go │ ├── spec_test.go │ ├── tag.go │ ├── tag_expr.go │ ├── tag_expr_test.go │ ├── target.go │ ├── target_test.go │ ├── task.go │ ├── task_test.go │ ├── theme.go │ ├── theme_block.go │ ├── theme_stream.go │ ├── theme_table.go │ ├── theme_tree.go │ ├── theme_tui.go │ └── utils_test.go ├── errors.go ├── exec │ ├── client.go │ ├── clone.go │ ├── exec.go │ ├── table.go │ ├── text.go │ ├── unix.go │ └── windows.go ├── flags.go ├── man.go ├── man_gen.go ├── mani.1 ├── prefixer.go ├── print │ ├── lib.go │ ├── print_block.go │ ├── print_table.go │ ├── print_tree.go │ └── table.go ├── sizedwaitgroup.go ├── tui │ ├── components │ │ ├── tui_button.go │ │ ├── tui_checkbox.go │ │ ├── tui_filter.go │ │ ├── tui_list.go │ │ ├── tui_modal.go │ │ ├── tui_output.go │ │ ├── tui_search.go │ │ ├── tui_table.go │ │ ├── tui_text.go │ │ ├── tui_textarea.go │ │ ├── tui_toggle_text.go │ │ └── tui_tree.go │ ├── misc │ │ ├── tui_event.go │ │ ├── tui_focus.go │ │ ├── tui_global.go │ │ ├── tui_theme.go │ │ ├── tui_utils.go │ │ └── tui_writer.go │ ├── pages.go │ ├── pages │ │ ├── tui_exec.go │ │ ├── tui_project.go │ │ ├── tui_run.go │ │ └── tui_task.go │ ├── tui.go │ ├── tui_input.go │ ├── views │ │ ├── tui_help.go │ │ ├── tui_project_view.go │ │ ├── tui_shortcut_info.go │ │ ├── tui_spec_view.go │ │ └── tui_task_view.go │ └── watcher.go └── utils.go ├── docs ├── changelog.md ├── commands.md ├── config.md ├── contributing.md ├── development.md ├── error-handling.md ├── examples.md ├── filtering-projects.md ├── installation.md ├── introduction.md ├── man-pages.md ├── output.md ├── project-background.md ├── roadmap.md ├── shell-completion.mdx ├── usage.md └── variables.md ├── examples ├── .gitignore ├── README.md └── mani.yaml ├── go.mod ├── go.sum ├── install.sh ├── main.go ├── res ├── demo.gif ├── demo.md ├── demo.vhs ├── graph-full.svg ├── graph.svg ├── logo.png ├── logo.svg └── mani.yaml ├── scripts └── release.sh └── test ├── README.md ├── fixtures ├── mani-advanced │ ├── .gitignore │ └── mani.yaml ├── mani-empty │ └── mani.yaml └── mani-no-tasks │ └── mani.yaml ├── images ├── alpine.exec.Dockerfile └── alpine.test.Dockerfile ├── integration ├── describe_test.go ├── exec_test.go ├── golden │ ├── describe │ │ ├── golden-0 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-1 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-2 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-3 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-4 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-5 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-6 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-7 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-8 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ └── golden-9 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ ├── exec │ │ ├── golden-0 │ │ │ └── stdout.golden │ │ ├── golden-1 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-2 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-3 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-4 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-5 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ └── golden-6 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ ├── dashgrid │ │ │ │ └── empty │ │ │ └── pinto │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ └── empty │ ├── init │ │ ├── golden-0 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-1 │ │ │ ├── .gitignore │ │ │ ├── dashgrid │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── nameless │ │ │ │ └── empty │ │ │ ├── nested │ │ │ │ └── template-generator │ │ │ │ │ └── empty │ │ │ ├── stdout.golden │ │ │ └── tap-report │ │ │ │ └── empty │ │ └── golden-2 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ ├── list │ │ ├── golden-0 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-1 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-10 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-11 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-12 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-13 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-14 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-15 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-16 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-17 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-2 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-3 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-4 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-5 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-6 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-7 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ ├── golden-8 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ │ └── golden-9 │ │ │ ├── mani.yaml │ │ │ └── stdout.golden │ ├── run │ │ ├── golden-0 │ │ │ └── stdout.golden │ │ ├── golden-1 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-10 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-11 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-2 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-3 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-4 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-5 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-6 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-7 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ ├── golden-8 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ │ ├── dashgrid │ │ │ │ │ └── empty │ │ │ │ └── pinto │ │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ │ └── empty │ │ └── golden-9 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ ├── dashgrid │ │ │ │ └── empty │ │ │ └── pinto │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ └── empty │ ├── sync │ │ ├── golden-0 │ │ │ └── stdout.golden │ │ └── golden-1 │ │ │ ├── .gitignore │ │ │ ├── frontend │ │ │ ├── dashgrid │ │ │ │ └── empty │ │ │ └── pinto │ │ │ │ └── empty │ │ │ ├── mani.yaml │ │ │ ├── stdout.golden │ │ │ └── template-generator │ │ │ └── empty │ └── version │ │ ├── golden-0 │ │ └── stdout.golden │ │ └── golden-1 │ │ ├── mani.yaml │ │ └── stdout.golden ├── init_test.go ├── list_test.go ├── main_test.go ├── run_test.go ├── sync_test.go └── version_test.go ├── playground ├── .gitignore ├── imports │ ├── many-projects.yaml │ ├── projects.yaml │ ├── specs.yaml │ ├── targets.yaml │ ├── tasks.yaml │ └── themes.yaml └── mani.yaml └── scripts ├── exec ├── git └── test /.dockerignore: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://paypal.me/samiralajmovic", "https://www.buymeacoffee.com/alajmo"] 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report a bug 4 | title: '' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | - [ ] I have the latest version of mani 10 | - [ ] I have searched through the existing issues 11 | 12 | ## Info 13 | 14 | - OS 15 | - [ ] Linux 16 | - [ ] Mac OS X 17 | - [ ] Windows 18 | - [ ] other 19 | 20 | - Shell 21 | - [ ] Bash 22 | - [ ] Zsh 23 | - [ ] Fish 24 | - [ ] Powershell 25 | - [ ] other 26 | 27 | 28 | - Version: 29 | 30 | ## Problem / Steps to reproduce 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an feature for this project 4 | title: '' 5 | labels: 'enhancement' 6 | assignees: '' 7 | --- 8 | 9 | ## Is your feature request related to a problem? Please describe 10 | 11 | ## Describe the solution you'd like 12 | 13 | ## Additional context 14 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### What's Changed 2 | 3 | A description of the issue/feature; reference the issue number (if one exists). The Pull Request should not include fixes for issues other than the main issue/feature request. 4 | 5 | ### Technical Description 6 | 7 | Any specific technical detail that may provide additional context to aid code review. 8 | 9 | > Before opening a Pull Request you should read and agreed to the Contributor Code of Conduct (see `CONTRIBUTING.md`\) 10 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: release 2 | 3 | on: 4 | push: 5 | tags: 6 | - 'v*' 7 | 8 | jobs: 9 | release: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v3 15 | 16 | - name: Set up Go 17 | uses: actions/setup-go@v4 18 | with: 19 | go-version: '1.23' 20 | cache: false 21 | 22 | - name: Create release notes 23 | run: ./scripts/release.sh 24 | 25 | - name: Run GoReleaser 26 | uses: goreleaser/goreleaser-action@v3 27 | with: 28 | distribution: goreleaser 29 | version: latest 30 | args: release --release-notes=release-changelog.md 31 | env: 32 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.GH_PAT }} 34 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: test 2 | 3 | on: 4 | pull_request: 5 | branches: [main] 6 | paths-ignore: 7 | - '**.md' 8 | jobs: 9 | test: 10 | name: test 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | os: [ubuntu-latest] 15 | go: ['1.23'] 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@v3 20 | 21 | - name: Set up Go 22 | uses: actions/setup-go@v4 23 | with: 24 | go-version: '1.23' 25 | cache: false 26 | 27 | - name: golangci-lint 28 | uses: golangci/golangci-lint-action@v3 29 | 30 | - name: Get dependencies 31 | run: go get -v -t -d ./... 32 | 33 | - name: Test 34 | run: make test 35 | 36 | - name: Build 37 | run: make build 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | vendor/ 16 | 17 | dist 18 | target 19 | test/tmp 20 | examples/frontend 21 | release-changelog.md 22 | 23 | .netlify 24 | .tags 25 | 26 | assets 27 | .config 28 | 29 | res/go 30 | -------------------------------------------------------------------------------- /.goreleaser.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | project_name: mani 3 | 4 | before: 5 | hooks: 6 | - go mod download 7 | 8 | builds: 9 | - binary: mani 10 | id: mani 11 | ldflags: -s -w -X github.com/alajmo/mani/cmd.version={{ .Version }} -X github.com/alajmo/mani/cmd.commit={{ .ShortCommit }} -X github.com/alajmo/mani/cmd.date={{ .Date }} 12 | env: 13 | - CGO_ENABLED=0 14 | goos: 15 | - darwin 16 | - linux 17 | - windows 18 | - freebsd 19 | - netbsd 20 | - openbsd 21 | goarch: 22 | - amd64 23 | - '386' 24 | - arm 25 | - arm64 26 | goarm: 27 | - '7' 28 | 29 | ignore: 30 | - goos: freebsd 31 | goarch: arm 32 | - goos: freebsd 33 | goarch: arm64 34 | 35 | - goos: openbsd 36 | goarch: arm 37 | - goos: openbsd 38 | goarch: arm64 39 | 40 | - goos: darwin 41 | goarch: arm 42 | - goos: darwin 43 | goarch: '386' 44 | 45 | - goos: windows 46 | goarch: arm 47 | - goos: windows 48 | goarch: arm64 49 | 50 | archives: 51 | - id: 'mani' 52 | builds: ['mani'] 53 | format: tar.gz 54 | format_overrides: 55 | - goos: windows 56 | format: zip 57 | name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' 58 | files: 59 | - LICENSE 60 | - src: 'core/mani.1' 61 | dst: '.' 62 | strip_parent: true 63 | 64 | brews: 65 | - name: mani 66 | description: 'CLI tool to help you manage multiple repositories' 67 | homepage: 'https://manicli.com' 68 | license: 'MIT' 69 | repository: 70 | owner: alajmo 71 | name: homebrew-mani 72 | token: '{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}' 73 | directory: Formula 74 | 75 | checksum: 76 | name_template: 'checksums.txt' 77 | 78 | snapshot: 79 | version_template: '{{ .Tag }}' 80 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020-2021 Samir Alajmovic 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | NAME := mani 2 | PACKAGE := github.com/alajmo/$(NAME) 3 | DATE := $(shell date +"%Y %B %d") 4 | GIT := $(shell [ -d .git ] && git rev-parse --short HEAD) 5 | VERSION := v0.31.0 6 | 7 | default: build 8 | 9 | tidy: 10 | go get -u && go mod tidy 11 | 12 | gofmt: 13 | go fmt ./cmd/***.go 14 | go fmt ./core/***.go 15 | go fmt ./core/dao/***.go 16 | go fmt ./core/exec/***.go 17 | go fmt ./core/print/***.go 18 | go fmt ./core/tui/***.go 19 | go fmt ./test/integration/***.go 20 | 21 | lint: 22 | golangci-lint run ./cmd/... ./core/... 23 | deadcode . 24 | 25 | test: 26 | # Unit tests 27 | go test -v ./core/dao/*** 28 | 29 | # Integration tests 30 | ./test/scripts/test --build --count 5 --clean 31 | 32 | test-unit: 33 | go test -v ./core/dao/*** 34 | 35 | test-integration: 36 | ./test/scripts/test --count 5 --build --clean 37 | 38 | update-golden-files: 39 | ./test/scripts/test --build --update 40 | 41 | build: 42 | CGO_ENABLED=0 go build \ 43 | -ldflags "-w -X '${PACKAGE}/cmd.version=${VERSION}' -X '${PACKAGE}/core/tui.version=${VERSION}' -X '${PACKAGE}/cmd.commit=${GIT}' -X '${PACKAGE}/cmd.date=${DATE}'" \ 44 | -a -tags netgo -o dist/${NAME} main.go 45 | 46 | build-all: 47 | goreleaser release --snapshot --clean 48 | 49 | build-test: 50 | CGO_ENABLED=0 go build \ 51 | -ldflags "-X '${PACKAGE}/core/dao.build_mode=TEST'" \ 52 | -a -tags netgo -o dist/${NAME} main.go 53 | 54 | gen-man: 55 | go run -ldflags="-X 'github.com/alajmo/mani/cmd.buildMode=man' -X '${PACKAGE}/cmd.version=${VERSION}' -X '${PACKAGE}/cmd.commit=${GIT}' -X '${PACKAGE}/cmd.date=${DATE}'" ./main.go gen-docs 56 | 57 | release: 58 | git tag ${VERSION} && git push origin ${VERSION} 59 | 60 | clean: 61 | $(RM) -r dist target 62 | 63 | .PHONY: tidy gofmt lint test test-unit test-integration update-golden-files build build-all build-test gen-man release clean 64 | -------------------------------------------------------------------------------- /cmd/check.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/spf13/cobra" 7 | 8 | "github.com/alajmo/mani/core" 9 | ) 10 | 11 | func checkCmd(configErr *error) *cobra.Command { 12 | cmd := cobra.Command{ 13 | Use: "check", 14 | Short: "Validate config", 15 | Long: `Validate config.`, 16 | Example: ` # Validate config 17 | mani check`, 18 | Args: cobra.NoArgs, 19 | Run: func(cmd *cobra.Command, args []string) { 20 | if *configErr != nil { 21 | fmt.Printf("Found configuration errors:\n\n") 22 | core.Exit(*configErr) 23 | } 24 | 25 | fmt.Println("Config Valid") 26 | }, 27 | DisableAutoGenTag: true, 28 | } 29 | 30 | return &cmd 31 | } 32 | -------------------------------------------------------------------------------- /cmd/describe.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | ) 9 | 10 | func describeCmd(config *dao.Config, configErr *error) *cobra.Command { 11 | var describeFlags core.DescribeFlags 12 | 13 | cmd := cobra.Command{ 14 | Aliases: []string{"desc"}, 15 | Use: "describe", 16 | Short: "Describe projects and tasks", 17 | Long: "Describe projects and tasks.", 18 | Example: ` # Describe all projects 19 | mani describe projects 20 | 21 | # Describe all tasks 22 | mani describe tasks`, 23 | DisableAutoGenTag: true, 24 | } 25 | 26 | cmd.AddCommand( 27 | describeProjectsCmd(config, configErr, &describeFlags), 28 | describeTasksCmd(config, configErr, &describeFlags), 29 | ) 30 | 31 | cmd.PersistentFlags().StringVar(&describeFlags.Theme, "theme", "default", "set theme") 32 | err := cmd.RegisterFlagCompletionFunc("theme", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 33 | if *configErr != nil { 34 | return []string{}, cobra.ShellCompDirectiveDefault 35 | } 36 | names := config.GetThemeNames() 37 | return names, cobra.ShellCompDirectiveDefault 38 | }) 39 | core.CheckIfError(err) 40 | 41 | return &cmd 42 | } 43 | -------------------------------------------------------------------------------- /cmd/edit.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | ) 9 | 10 | func editCmd(config *dao.Config, configErr *error) *cobra.Command { 11 | cmd := cobra.Command{ 12 | Aliases: []string{"e", "ed"}, 13 | Use: "edit", 14 | Short: "Open up mani config file", 15 | Long: "Open up mani config file in $EDITOR.", 16 | 17 | Example: ` # Edit current context 18 | mani edit`, 19 | Run: func(cmd *cobra.Command, args []string) { 20 | err := *configErr 21 | switch e := err.(type) { 22 | case *core.ConfigNotFound: 23 | core.CheckIfError(e) 24 | default: 25 | runEdit(*config) 26 | } 27 | }, 28 | DisableAutoGenTag: true, 29 | } 30 | 31 | cmd.AddCommand( 32 | editTask(config, configErr), 33 | editProject(config, configErr), 34 | ) 35 | 36 | return &cmd 37 | } 38 | 39 | func runEdit(config dao.Config) { 40 | err := config.EditConfig() 41 | core.CheckIfError(err) 42 | } 43 | -------------------------------------------------------------------------------- /cmd/edit_project.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | ) 9 | 10 | func editProject(config *dao.Config, configErr *error) *cobra.Command { 11 | cmd := cobra.Command{ 12 | Aliases: []string{"projects", "proj", "pr"}, 13 | Use: "project [project]", 14 | Short: "Edit mani project", 15 | Long: `Edit mani project in $EDITOR.`, 16 | 17 | Example: ` # Edit projects 18 | mani edit project 19 | 20 | # Edit project 21 | mani edit project `, 22 | Run: func(cmd *cobra.Command, args []string) { 23 | err := *configErr 24 | switch e := err.(type) { 25 | case *core.ConfigNotFound: 26 | core.CheckIfError(e) 27 | default: 28 | runEditProject(args, *config) 29 | } 30 | }, 31 | Args: cobra.MaximumNArgs(1), 32 | ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 33 | if *configErr != nil || len(args) == 1 { 34 | return []string{}, cobra.ShellCompDirectiveDefault 35 | } 36 | 37 | values := config.GetProjectNames() 38 | return values, cobra.ShellCompDirectiveNoFileComp 39 | }, 40 | DisableAutoGenTag: true, 41 | } 42 | 43 | return &cmd 44 | } 45 | 46 | func runEditProject(args []string, config dao.Config) { 47 | if len(args) > 0 { 48 | err := config.EditProject(args[0]) 49 | core.CheckIfError(err) 50 | } else { 51 | err := config.EditProject("") 52 | core.CheckIfError(err) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /cmd/edit_task.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | ) 9 | 10 | func editTask(config *dao.Config, configErr *error) *cobra.Command { 11 | cmd := cobra.Command{ 12 | Aliases: []string{"tasks", "tsks", "tsk"}, 13 | Use: "task [task]", 14 | Short: "Edit mani task", 15 | Long: `Edit mani task in $EDITOR.`, 16 | 17 | Example: ` # Edit tasks 18 | mani edit task 19 | 20 | # Edit task 21 | mani edit task `, 22 | Run: func(cmd *cobra.Command, args []string) { 23 | err := *configErr 24 | switch e := err.(type) { 25 | case *core.ConfigNotFound: 26 | core.CheckIfError(e) 27 | default: 28 | runEditTask(args, *config) 29 | } 30 | }, 31 | Args: cobra.MaximumNArgs(1), 32 | ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 33 | if *configErr != nil || len(args) == 1 { 34 | return []string{}, cobra.ShellCompDirectiveDefault 35 | } 36 | 37 | values := config.GetTaskNames() 38 | return values, cobra.ShellCompDirectiveNoFileComp 39 | }, 40 | DisableAutoGenTag: true, 41 | } 42 | 43 | return &cmd 44 | } 45 | 46 | func runEditTask(args []string, config dao.Config) { 47 | if len(args) > 0 { 48 | err := config.EditTask(args[0]) 49 | core.CheckIfError(err) 50 | } else { 51 | err := config.EditTask("") 52 | core.CheckIfError(err) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /cmd/gen.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | ) 8 | 9 | func genCmd() *cobra.Command { 10 | dir := "" 11 | cmd := cobra.Command{ 12 | Use: "gen", 13 | Short: "Generate man page", 14 | DisableFlagsInUseLine: true, 15 | Run: func(cmd *cobra.Command, args []string) { 16 | err := core.GenManPages(dir) 17 | core.CheckIfError(err) 18 | }, 19 | 20 | DisableAutoGenTag: true, 21 | } 22 | 23 | cmd.Flags().StringVarP(&dir, "dir", "d", "./", "directory to save manpage to") 24 | err := cmd.RegisterFlagCompletionFunc("dir", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 25 | return nil, cobra.ShellCompDirectiveFilterDirs 26 | }) 27 | core.CheckIfError(err) 28 | 29 | return &cmd 30 | } 31 | -------------------------------------------------------------------------------- /cmd/gen_docs.go: -------------------------------------------------------------------------------- 1 | // This source will generate 2 | // - core/mani.1 3 | // - docs/commands.md 4 | // 5 | // and is not included in the final build. 6 | 7 | package cmd 8 | 9 | import ( 10 | "github.com/spf13/cobra" 11 | 12 | "github.com/alajmo/mani/core" 13 | ) 14 | 15 | func genDocsCmd(longAppDesc string) *cobra.Command { 16 | cmd := cobra.Command{ 17 | Use: "gen-docs", 18 | Short: "Generate man and markdown pages", 19 | DisableFlagsInUseLine: true, 20 | Run: func(cmd *cobra.Command, args []string) { 21 | err := core.CreateManPage( 22 | longAppDesc, 23 | version, 24 | date, 25 | rootCmd, 26 | runCmd(&config, &configErr), 27 | execCmd(&config, &configErr), 28 | initCmd(), 29 | syncCmd(&config, &configErr), 30 | editCmd(&config, &configErr), 31 | listCmd(&config, &configErr), 32 | describeCmd(&config, &configErr), 33 | tuiCmd(&config, &configErr), 34 | checkCmd(&configErr), 35 | genCmd(), 36 | ) 37 | core.CheckIfError(err) 38 | }, 39 | 40 | DisableAutoGenTag: true, 41 | } 42 | 43 | return &cmd 44 | } 45 | -------------------------------------------------------------------------------- /cmd/init.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | "github.com/alajmo/mani/core/exec" 9 | ) 10 | 11 | func initCmd() *cobra.Command { 12 | var initFlags core.InitFlags 13 | 14 | cmd := cobra.Command{ 15 | Use: "init", 16 | Short: "Initialize a mani repository", 17 | Long: `Initialize a mani repository. 18 | 19 | Creates a new mani repository by generating a mani.yaml configuration file 20 | and a .gitignore file in the current directory.`, 21 | 22 | Example: ` # Initialize with default settings 23 | mani init 24 | 25 | # Initialize without auto-discovering projects 26 | mani init --auto-discovery=false 27 | 28 | # Initialize without updating .gitignore 29 | mani init --sync-gitignore=false`, 30 | 31 | Args: cobra.MaximumNArgs(1), 32 | Run: func(cmd *cobra.Command, args []string) { 33 | foundProjects, err := dao.InitMani(args, initFlags) 34 | core.CheckIfError(err) 35 | 36 | if initFlags.AutoDiscovery { 37 | exec.PrintProjectInit(foundProjects) 38 | } 39 | }, 40 | DisableAutoGenTag: true, 41 | } 42 | 43 | cmd.Flags().BoolVar(&initFlags.AutoDiscovery, "auto-discovery", true, "automatically discover and add Git repositories to mani.yaml") 44 | cmd.Flags().BoolVarP(&initFlags.SyncGitignore, "sync-gitignore", "g", true, "synchronize .gitignore file") 45 | 46 | return &cmd 47 | } 48 | -------------------------------------------------------------------------------- /cmd/list.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/spf13/cobra" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | ) 9 | 10 | func listCmd(config *dao.Config, configErr *error) *cobra.Command { 11 | var listFlags core.ListFlags 12 | 13 | cmd := cobra.Command{ 14 | Aliases: []string{"ls", "l"}, 15 | Use: "list", 16 | Short: "List projects, tasks and tags", 17 | Long: "List projects, tasks and tags.", 18 | Example: ` # List all projects 19 | mani list projects 20 | 21 | # List all tasks 22 | mani list tasks 23 | 24 | # List all tags 25 | mani list tags`, 26 | DisableAutoGenTag: true, 27 | } 28 | 29 | cmd.AddCommand( 30 | listProjectsCmd(config, configErr, &listFlags), 31 | listTasksCmd(config, configErr, &listFlags), 32 | listTagsCmd(config, configErr, &listFlags), 33 | ) 34 | 35 | cmd.PersistentFlags().StringVar(&listFlags.Theme, "theme", "default", "set theme") 36 | err := cmd.RegisterFlagCompletionFunc("theme", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 37 | if *configErr != nil { 38 | return []string{}, cobra.ShellCompDirectiveDefault 39 | } 40 | names := config.GetThemeNames() 41 | return names, cobra.ShellCompDirectiveDefault 42 | }) 43 | core.CheckIfError(err) 44 | 45 | cmd.PersistentFlags().StringVarP(&listFlags.Output, "output", "o", "table", "set output format [table|markdown|html]") 46 | err = cmd.RegisterFlagCompletionFunc("output", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 47 | if *configErr != nil { 48 | return []string{}, cobra.ShellCompDirectiveDefault 49 | } 50 | 51 | valid := []string{"table", "markdown", "html"} 52 | return valid, cobra.ShellCompDirectiveDefault 53 | }) 54 | core.CheckIfError(err) 55 | 56 | return &cmd 57 | } 58 | -------------------------------------------------------------------------------- /cmd/tui.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/alajmo/mani/core" 5 | "github.com/alajmo/mani/core/dao" 6 | "github.com/alajmo/mani/core/tui" 7 | "github.com/spf13/cobra" 8 | ) 9 | 10 | func tuiCmd(config *dao.Config, configErr *error) *cobra.Command { 11 | var tuiFlags core.TUIFlags 12 | 13 | cmd := cobra.Command{ 14 | Use: "tui", 15 | Aliases: []string{"gui"}, 16 | Short: "TUI", 17 | Long: `Run TUI`, 18 | Example: ` # Open tui 19 | mani tui`, 20 | Run: func(cmd *cobra.Command, args []string) { 21 | core.CheckIfError(*configErr) 22 | reloadChanged := cmd.Flags().Changed("reload-on-change") 23 | reload := config.ReloadTUI 24 | if reloadChanged { 25 | reload = &tuiFlags.Reload 26 | } 27 | 28 | tui.RunTui(config, tuiFlags.Theme, *reload) 29 | }, 30 | DisableAutoGenTag: true, 31 | } 32 | 33 | cmd.PersistentFlags().StringVar(&tuiFlags.Theme, "theme", "default", "set theme") 34 | err := cmd.RegisterFlagCompletionFunc("theme", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { 35 | if *configErr != nil { 36 | return []string{}, cobra.ShellCompDirectiveDefault 37 | } 38 | 39 | names := config.GetThemeNames() 40 | 41 | return names, cobra.ShellCompDirectiveDefault 42 | }) 43 | core.CheckIfError(err) 44 | 45 | cmd.Flags().BoolVarP(&tuiFlags.Reload, "reload-on-change", "r", false, "reload mani on config change") 46 | 47 | return &cmd 48 | } 49 | -------------------------------------------------------------------------------- /core/dao/config_test.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestConfig_DuplicateProjectName(t *testing.T) { 8 | originalProjects := []Project{ 9 | {Name: "project-a", Path: "sub-1/project-a"}, 10 | {Name: "project-a", Path: "sub-2/project-a"}, 11 | {Name: "project-b", Path: "sub-3/project-b"}, 12 | } 13 | 14 | var projects []Project 15 | projects = append(projects, originalProjects...) 16 | RenameDuplicates(projects) 17 | 18 | if projects[0].Name != originalProjects[0].Path { 19 | t.Fatalf(`Wanted: %q, Found: %q`, projects[0].Path, originalProjects[0].Name) 20 | } 21 | 22 | if projects[1].Name != originalProjects[1].Path { 23 | t.Fatalf(`Wanted: %q, Found: %q`, projects[1].Path, originalProjects[1].Name) 24 | } 25 | 26 | if originalProjects[2].Name != projects[2].Name { 27 | t.Fatalf(`Wanted: %q, Found: %q`, projects[2].Name, originalProjects[2].Name) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/dao/tag.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/alajmo/mani/core" 7 | ) 8 | 9 | type Tag struct { 10 | Name string 11 | Projects []string 12 | } 13 | 14 | func (t Tag) GetValue(key string, _ int) string { 15 | switch key { 16 | case "Tag", "tag": 17 | return t.Name 18 | case "Project", "project": 19 | return strings.Join(t.Projects, "\n") 20 | } 21 | 22 | return "" 23 | } 24 | 25 | func (c Config) GetTags() []string { 26 | tags := []string{} 27 | for _, project := range c.ProjectList { 28 | for _, tag := range project.Tags { 29 | if !core.StringInSlice(tag, tags) { 30 | tags = append(tags, tag) 31 | } 32 | } 33 | } 34 | 35 | return tags 36 | } 37 | 38 | func (c Config) GetTagAssocations(tags []string) ([]Tag, error) { 39 | t := []Tag{} 40 | 41 | for _, tag := range tags { 42 | projects, err := c.GetProjectsByTags([]string{tag}) 43 | if err != nil { 44 | return []Tag{}, err 45 | } 46 | 47 | var projectNames []string 48 | for _, p := range projects { 49 | projectNames = append(projectNames, p.Name) 50 | } 51 | 52 | t = append(t, Tag{Name: tag, Projects: projectNames}) 53 | } 54 | 55 | return t, nil 56 | } 57 | -------------------------------------------------------------------------------- /core/dao/theme_block.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "github.com/alajmo/mani/core" 5 | ) 6 | 7 | var DefaultBlock = Block{ 8 | Key: &ColorOptions{ 9 | Fg: core.Ptr("#5f87d7"), 10 | Attr: core.Ptr(""), 11 | Format: core.Ptr(""), 12 | }, 13 | 14 | Separator: &ColorOptions{ 15 | Fg: core.Ptr("#5f87d7"), 16 | Attr: core.Ptr(""), 17 | Format: core.Ptr(""), 18 | }, 19 | 20 | Value: &ColorOptions{ 21 | Fg: core.Ptr(""), 22 | Attr: core.Ptr(""), 23 | Format: core.Ptr(""), 24 | }, 25 | 26 | ValueTrue: &ColorOptions{ 27 | Fg: core.Ptr("#00af5f"), 28 | Attr: core.Ptr(""), 29 | Format: core.Ptr(""), 30 | }, 31 | 32 | ValueFalse: &ColorOptions{ 33 | Fg: core.Ptr("#d75f5f"), 34 | Attr: core.Ptr(""), 35 | Format: core.Ptr(""), 36 | }, 37 | } 38 | 39 | type Block struct { 40 | Key *ColorOptions `yaml:"key"` 41 | Separator *ColorOptions `yaml:"separator"` 42 | Value *ColorOptions `yaml:"value"` 43 | ValueTrue *ColorOptions `yaml:"value_true"` 44 | ValueFalse *ColorOptions `yaml:"value_false"` 45 | } 46 | 47 | func LoadBlockTheme(block *Block) { 48 | if block.Key == nil { 49 | block.Key = DefaultBlock.Key 50 | } else { 51 | block.Key = MergeThemeOptions(block.Key, DefaultBlock.Key) 52 | } 53 | 54 | if block.Value == nil { 55 | block.Value = DefaultBlock.Value 56 | } else { 57 | block.Value = MergeThemeOptions(block.Value, DefaultBlock.Value) 58 | } 59 | 60 | if block.Separator == nil { 61 | block.Separator = DefaultBlock.Separator 62 | } else { 63 | block.Separator = MergeThemeOptions(block.Separator, DefaultBlock.Separator) 64 | } 65 | 66 | if block.ValueTrue == nil { 67 | block.ValueTrue = DefaultBlock.ValueTrue 68 | } else { 69 | block.ValueTrue = MergeThemeOptions(block.ValueTrue, DefaultBlock.ValueTrue) 70 | } 71 | 72 | if block.ValueFalse == nil { 73 | block.ValueFalse = DefaultBlock.ValueFalse 74 | } else { 75 | block.ValueFalse = MergeThemeOptions(block.ValueFalse, DefaultBlock.ValueFalse) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /core/dao/theme_stream.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | type Stream struct { 4 | Prefix bool `yaml:"prefix"` 5 | PrefixColors []string `yaml:"prefix_colors"` 6 | Header bool `yaml:"header"` 7 | HeaderChar string `yaml:"header_char"` 8 | HeaderPrefix string `yaml:"header_prefix"` 9 | } 10 | 11 | var DefaultStream = Stream{ 12 | Prefix: true, 13 | Header: true, 14 | HeaderPrefix: "TASK", 15 | HeaderChar: "*", 16 | PrefixColors: []string{"#d787ff", "#00af5f", "#d75f5f", "#5f87d7", "#00af87", "#5f00ff"}, 17 | } 18 | 19 | func LoadStreamTheme(stream *Stream) { 20 | if stream.PrefixColors == nil { 21 | stream.PrefixColors = DefaultStream.PrefixColors 22 | } else { 23 | for j := range stream.PrefixColors { 24 | stream.PrefixColors[j] = *convertToHex(&stream.PrefixColors[j]) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /core/dao/theme_tree.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | type Tree struct { 8 | Style string `yaml:"style"` 9 | } 10 | 11 | var DefaultTree = Tree{ 12 | Style: "light", 13 | } 14 | 15 | func LoadTreeTheme(tree *Tree) { 16 | style := strings.ToLower(tree.Style) 17 | switch style { 18 | case "light": 19 | tree.Style = "light" 20 | case "bullet-flower": 21 | tree.Style = "bullet-flower" 22 | case "bullet-square": 23 | tree.Style = "bullet-square" 24 | case "bullet-star": 25 | tree.Style = "bullet-star" 26 | case "bullet-triangle": 27 | tree.Style = "bullet-triangle" 28 | case "bold": 29 | tree.Style = "bold" 30 | case "double": 31 | tree.Style = "double" 32 | case "rounded": 33 | tree.Style = "rounded" 34 | case "markdown": 35 | tree.Style = "markdown" 36 | default: 37 | tree.Style = "ascii" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /core/dao/utils_test.go: -------------------------------------------------------------------------------- 1 | package dao 2 | 3 | import ( 4 | "reflect" 5 | "sort" 6 | ) 7 | 8 | // Helper functions 9 | 10 | func getProjectNames(projects []Project) []string { 11 | names := make([]string, len(projects)) 12 | for i, p := range projects { 13 | names[i] = p.Name 14 | } 15 | sort.Strings(names) 16 | return names 17 | } 18 | 19 | func getTreePaths(nodes []TreeNode) []string { 20 | paths := make([]string, len(nodes)) 21 | for i, node := range nodes { 22 | paths[i] = node.Path 23 | } 24 | sort.Strings(paths) 25 | return paths 26 | } 27 | 28 | func equalStringSlices(a, b []string) bool { 29 | if len(a) != len(b) { 30 | return false 31 | } 32 | 33 | aCopy := make([]string, len(a)) 34 | bCopy := make([]string, len(b)) 35 | copy(aCopy, a) 36 | copy(bCopy, b) 37 | 38 | sort.Strings(aCopy) 39 | sort.Strings(bCopy) 40 | 41 | return reflect.DeepEqual(aCopy, bCopy) 42 | } 43 | -------------------------------------------------------------------------------- /core/exec/client.go: -------------------------------------------------------------------------------- 1 | package exec 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | "os/exec" 8 | ) 9 | 10 | // Client is a wrapper over the SSH connection/sessions. 11 | type Client struct { 12 | Name string 13 | Path string 14 | Env []string 15 | 16 | cmd *exec.Cmd 17 | stdout io.Reader 18 | stderr io.Reader 19 | running bool 20 | } 21 | 22 | func (c *Client) Run(shell string, env []string, cmdStr []string) error { 23 | var err error 24 | if c.running { 25 | return fmt.Errorf("command already running") 26 | } 27 | 28 | cmd := exec.Command(shell, cmdStr...) 29 | 30 | cmd.Dir = c.Path 31 | cmd.Env = append(os.Environ(), env...) 32 | 33 | c.cmd = cmd 34 | 35 | c.stdout, err = cmd.StdoutPipe() 36 | if err != nil { 37 | return err 38 | } 39 | 40 | c.stderr, err = cmd.StderrPipe() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | if err := c.cmd.Start(); err != nil { 46 | return err 47 | } 48 | 49 | c.running = true 50 | 51 | return nil 52 | } 53 | 54 | func (c *Client) Wait() error { 55 | if !c.running { 56 | return fmt.Errorf("trying to wait on stopped command") 57 | } 58 | 59 | err := c.cmd.Wait() 60 | c.running = false 61 | 62 | return err 63 | } 64 | 65 | func (c *Client) Close() error { 66 | return nil 67 | } 68 | 69 | func (c *Client) Stderr() io.Reader { 70 | return c.stderr 71 | } 72 | 73 | func (c *Client) Stdout() io.Reader { 74 | return c.stdout 75 | } 76 | 77 | func (c *Client) Prefix() string { 78 | return c.Name 79 | } 80 | -------------------------------------------------------------------------------- /core/exec/unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package exec 5 | 6 | import ( 7 | "os" 8 | "os/exec" 9 | 10 | "golang.org/x/sys/unix" 11 | ) 12 | 13 | func ExecTTY(cmd string, envs []string) error { 14 | shell := "bash" 15 | foundShell, found := os.LookupEnv("SHELL") 16 | if found { 17 | shell = foundShell 18 | } 19 | 20 | execBin, err := exec.LookPath(shell) 21 | if err != nil { 22 | return err 23 | } 24 | 25 | userEnv := append(os.Environ(), envs...) 26 | err = unix.Exec(execBin, []string{shell, "-c", cmd}, userEnv) 27 | if err != nil { 28 | return err 29 | } 30 | 31 | return nil 32 | } 33 | -------------------------------------------------------------------------------- /core/exec/windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package exec 5 | 6 | func ExecTTY(cmd string, envs []string) error { 7 | return nil 8 | } 9 | -------------------------------------------------------------------------------- /core/man.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import ( 4 | _ "embed" 5 | "fmt" 6 | "os" 7 | "path/filepath" 8 | ) 9 | 10 | //go:embed mani.1 11 | var CONFIG_MAN []byte 12 | 13 | func GenManPages(dir string) error { 14 | manPath := filepath.Join(dir, "mani.1") 15 | err := os.WriteFile(manPath, CONFIG_MAN, 0644) 16 | CheckIfError(err) 17 | 18 | fmt.Printf("Created %s\n", manPath) 19 | 20 | return nil 21 | } 22 | -------------------------------------------------------------------------------- /core/print/lib.go: -------------------------------------------------------------------------------- 1 | package print 2 | 3 | import ( 4 | "bufio" 5 | "strings" 6 | "unicode/utf8" 7 | ) 8 | 9 | func GetMaxTextWidth(text string) int { 10 | scanner := bufio.NewScanner(strings.NewReader(text)) 11 | maxWidth := 0 12 | 13 | for scanner.Scan() { 14 | lineWidth := utf8.RuneCountInString(scanner.Text()) 15 | if lineWidth > maxWidth { 16 | maxWidth = lineWidth 17 | } 18 | } 19 | 20 | return maxWidth 21 | } 22 | 23 | func GetTextDimensions(text string) (int, int) { 24 | // TODO: Seems it also counts color codes, so need to skip that 25 | scanner := bufio.NewScanner(strings.NewReader(text)) 26 | maxWidth := 0 27 | height := 0 28 | 29 | for scanner.Scan() { 30 | height++ 31 | lineWidth := utf8.RuneCountInString(scanner.Text()) 32 | if lineWidth > maxWidth { 33 | maxWidth = lineWidth 34 | } 35 | } 36 | 37 | return maxWidth, height 38 | } 39 | -------------------------------------------------------------------------------- /core/print/print_table.go: -------------------------------------------------------------------------------- 1 | package print 2 | 3 | import ( 4 | "io" 5 | 6 | "github.com/alajmo/mani/core/dao" 7 | "github.com/jedib0t/go-pretty/v6/table" 8 | ) 9 | 10 | type Items interface { 11 | GetValue(string, int) string 12 | } 13 | 14 | type PrintTableOptions struct { 15 | Output string 16 | Theme dao.Theme 17 | Tree bool 18 | Color bool 19 | AutoWrap bool 20 | OmitEmptyRows bool 21 | OmitEmptyColumns bool 22 | } 23 | 24 | func PrintTable[T Items]( 25 | data []T, 26 | options PrintTableOptions, 27 | defaultHeaders []string, 28 | taskHeaders []string, 29 | writer io.Writer, 30 | ) { 31 | // Colors not supported for markdown and html 32 | switch options.Output { 33 | case "markdown": 34 | options.Color = false 35 | case "html": 36 | options.Color = false 37 | } 38 | 39 | t := CreateTable(options, defaultHeaders, taskHeaders, data, writer) 40 | theme := options.Theme 41 | 42 | // Headers 43 | var headers table.Row 44 | for _, h := range defaultHeaders { 45 | headers = append(headers, dao.StyleString(h, *theme.Table.Header, options.Color)) 46 | } 47 | for _, h := range taskHeaders { 48 | headers = append(headers, dao.StyleString(h, *theme.Table.Header, options.Color)) 49 | } 50 | t.AppendHeader(headers) 51 | 52 | // Rows 53 | headerNames := append(defaultHeaders, taskHeaders...) 54 | for _, item := range data { 55 | row := table.Row{} 56 | for i, h := range headerNames { 57 | value := item.GetValue(h, i) 58 | if i == 0 { 59 | value = dao.StyleString(value, *theme.Table.TitleColumn, options.Color) 60 | } 61 | row = append(row, value) 62 | } 63 | 64 | if options.OmitEmptyRows { 65 | empty := true 66 | for _, v := range row[1:] { 67 | if v != "" { 68 | empty = false 69 | break 70 | } 71 | } 72 | if empty { 73 | continue 74 | } 75 | } 76 | t.AppendRow(row) 77 | } 78 | 79 | RenderTable(t, options.Output) 80 | } 81 | -------------------------------------------------------------------------------- /core/print/print_tree.go: -------------------------------------------------------------------------------- 1 | package print 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/jedib0t/go-pretty/v6/list" 8 | 9 | "github.com/alajmo/mani/core" 10 | "github.com/alajmo/mani/core/dao" 11 | ) 12 | 13 | func PrintTree(config *dao.Config, theme dao.Theme, listFlags *core.ListFlags, tree []dao.TreeNode) { 14 | // Style 15 | var treeStyle list.Style 16 | switch theme.Tree.Style { 17 | case "light": 18 | treeStyle = list.StyleConnectedLight 19 | case "bullet-flower": 20 | treeStyle = list.StyleBulletFlower 21 | case "bullet-square": 22 | treeStyle = list.StyleBulletSquare 23 | case "bullet-star": 24 | treeStyle = list.StyleBulletStar 25 | case "bullet-triangle": 26 | treeStyle = list.StyleBulletTriangle 27 | case "bold": 28 | treeStyle = list.StyleConnectedBold 29 | case "double": 30 | treeStyle = list.StyleConnectedDouble 31 | case "rounded": 32 | treeStyle = list.StyleConnectedRounded 33 | case "markdown": 34 | treeStyle = list.StyleMarkdown 35 | default: 36 | treeStyle = list.StyleDefault 37 | } 38 | 39 | // Print 40 | l := list.NewWriter() 41 | l.SetStyle(treeStyle) 42 | printTreeNodes(l, tree, 0) 43 | switch listFlags.Output { 44 | case "markdown": 45 | printTree(l.RenderMarkdown()) 46 | case "html": 47 | printTree(l.RenderHTML()) 48 | default: 49 | printTree(l.Render()) 50 | } 51 | } 52 | 53 | func printTreeNodes(l list.Writer, tree []dao.TreeNode, depth int) { 54 | for _, n := range tree { 55 | for i := 0; i < depth; i++ { 56 | l.Indent() 57 | } 58 | 59 | l.AppendItem(n.Path) 60 | printTreeNodes(l, n.Children, depth+1) 61 | 62 | for i := 0; i < depth; i++ { 63 | l.UnIndent() 64 | } 65 | } 66 | } 67 | 68 | func printTree(content string) { 69 | for _, line := range strings.Split(content, "\n") { 70 | fmt.Printf("%s\n", line) 71 | } 72 | fmt.Println() 73 | } 74 | -------------------------------------------------------------------------------- /core/tui/components/tui_button.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/dao" 5 | "github.com/alajmo/mani/core/tui/misc" 6 | "github.com/gdamore/tcell/v2" 7 | "github.com/rivo/tview" 8 | ) 9 | 10 | func CreateButton(label string) *tview.Button { 11 | label = dao.StyleFormat(label, misc.STYLE_BUTTON.FormatStr) 12 | button := tview.NewButton(label) 13 | SetInactiveButtonStyle(button) 14 | return button 15 | } 16 | 17 | func SetActiveButtonStyle(button *tview.Button) { 18 | label := button.GetLabel() 19 | button.SetLabel(dao.StyleFormat(label, misc.STYLE_BUTTON_ACTIVE.FormatStr)) 20 | button. 21 | SetStyle(tcell.StyleDefault. 22 | Foreground(misc.STYLE_BUTTON_ACTIVE.Fg). 23 | Background(misc.STYLE_BUTTON_ACTIVE.Bg). 24 | Attributes(misc.STYLE_BUTTON_ACTIVE.Attr)). 25 | SetActivatedStyle(tcell.StyleDefault. 26 | Foreground(misc.STYLE_BUTTON_ACTIVE.Fg). 27 | Background(misc.STYLE_BUTTON_ACTIVE.Bg). 28 | Attributes(misc.STYLE_BUTTON_ACTIVE.Attr)) 29 | } 30 | 31 | func SetInactiveButtonStyle(button *tview.Button) { 32 | label := button.GetLabel() 33 | button.SetLabel(dao.StyleFormat(label, misc.STYLE_BUTTON.FormatStr)) 34 | button. 35 | SetStyle(tcell.StyleDefault. 36 | Foreground(misc.STYLE_BUTTON.Fg). 37 | Background(misc.STYLE_BUTTON.Bg). 38 | Attributes(misc.STYLE_BUTTON.Attr)). 39 | SetActivatedStyle(tcell.StyleDefault. 40 | Foreground(misc.STYLE_BUTTON.Fg). 41 | Background(misc.STYLE_BUTTON.Bg). 42 | Attributes(misc.STYLE_BUTTON.Attr)) 43 | } 44 | -------------------------------------------------------------------------------- /core/tui/components/tui_checkbox.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/tui/misc" 5 | "github.com/rivo/tview" 6 | ) 7 | 8 | func Checkbox(label string, checked *bool, onFocus func(), onBlur func()) *tview.Checkbox { 9 | checkbox := tview.NewCheckbox().SetLabel(" " + label + " ") 10 | checkbox.SetChecked(*checked) 11 | checkbox.SetCheckedStyle(misc.STYLE_ITEM_SELECTED.Style) 12 | checkbox.SetUncheckedStyle(misc.STYLE_ITEM.Style) 13 | 14 | checkbox.SetFieldTextColor(misc.STYLE_ITEM_FOCUSED.Bg) 15 | checkbox.SetFieldBackgroundColor(misc.STYLE_ITEM.Bg) 16 | checkbox.SetCheckedString("") 17 | 18 | if *checked { 19 | checkbox.SetLabelStyle(misc.STYLE_ITEM_SELECTED.Style) 20 | } else { 21 | checkbox.SetLabelStyle(misc.STYLE_ITEM.Style) 22 | } 23 | 24 | // Callbacks 25 | checkbox.SetFocusFunc(func() { 26 | if *checked { 27 | checkbox.SetLabelColor(misc.STYLE_ITEM_SELECTED.Fg) 28 | } else { 29 | checkbox.SetLabelColor(misc.STYLE_ITEM_FOCUSED.Fg) 30 | } 31 | 32 | checkbox.SetBackgroundColor(misc.STYLE_ITEM_FOCUSED.Bg) 33 | onFocus() 34 | }) 35 | checkbox.SetBlurFunc(func() { 36 | if *checked { 37 | checkbox.SetLabelColor(misc.STYLE_ITEM_SELECTED.Fg) 38 | } else { 39 | checkbox.SetLabelColor(misc.STYLE_ITEM.Fg) 40 | } 41 | 42 | checkbox.SetBackgroundColor(misc.STYLE_ITEM.Bg) 43 | onBlur() 44 | }) 45 | checkbox.SetChangedFunc(func(isChecked bool) { 46 | if isChecked { 47 | checkbox.SetLabelStyle(misc.STYLE_ITEM_SELECTED.Style) 48 | } else { 49 | checkbox.SetLabelStyle(misc.STYLE_ITEM.Style) 50 | } 51 | *checked = !*checked 52 | }) 53 | 54 | return checkbox 55 | } 56 | -------------------------------------------------------------------------------- /core/tui/components/tui_filter.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/rivo/tview" 5 | 6 | "github.com/alajmo/mani/core/tui/misc" 7 | ) 8 | 9 | func CreateFilter() *tview.InputField { 10 | filter := tview.NewInputField(). 11 | SetLabel(""). 12 | SetLabelStyle(misc.STYLE_FILTER_LABEL.Style). 13 | SetFieldStyle(misc.STYLE_FILTER_TEXT.Style) 14 | 15 | return filter 16 | } 17 | 18 | func ShowFilter(filter *tview.InputField, text string) { 19 | filter.SetLabel(misc.Colorize("Filter:", *misc.TUITheme.FilterLabel)) 20 | filter.SetText(text) 21 | misc.App.SetFocus(filter) 22 | } 23 | 24 | func CloseFilter(filter *tview.InputField) { 25 | filter.SetLabel("") 26 | filter.SetText("") 27 | } 28 | 29 | func InitFilter(filter *tview.InputField, text string) { 30 | if text != "" { 31 | filter.SetLabel(" Filter: ") 32 | filter.SetText(text) 33 | } else { 34 | filter.SetLabel("") 35 | filter.SetText("") 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/tui/components/tui_output.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/tui/misc" 5 | "github.com/rivo/tview" 6 | ) 7 | 8 | func CreateOutputView(title string) (*tview.TextView, *misc.ThreadSafeWriter) { 9 | streamView := CreateText(title) 10 | ansiWriter := misc.NewThreadSafeWriter(streamView) 11 | 12 | return streamView, ansiWriter 13 | } 14 | -------------------------------------------------------------------------------- /core/tui/components/tui_text.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/tui/misc" 5 | "github.com/gdamore/tcell/v2" 6 | "github.com/rivo/tview" 7 | ) 8 | 9 | func CreateText(title string) *tview.TextView { 10 | textview := tview.NewTextView() 11 | textview.SetBorder(true) 12 | textview.SetBorderPadding(0, 0, 2, 1) 13 | textview.SetDynamicColors(true) 14 | textview.SetWrap(false) 15 | textTitle := title 16 | 17 | if textTitle != "" { 18 | textTitle = misc.Colorize(title, *misc.TUITheme.Title) 19 | textview.SetTitle(textTitle) 20 | } 21 | 22 | textview.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { 23 | _, _, _, height := textview.GetInnerRect() 24 | row, _ := textview.GetScrollOffset() 25 | switch { 26 | case event.Key() == tcell.KeyCtrlD || event.Rune() == 'd': 27 | textview.ScrollTo(row+height/2, 0) 28 | return nil 29 | case event.Key() == tcell.KeyCtrlU || event.Rune() == 'u': 30 | textview.ScrollTo(row-height/2, 0) 31 | return nil 32 | case event.Key() == tcell.KeyCtrlF || event.Rune() == 'f': 33 | textview.ScrollTo(row+height, 0) 34 | return nil 35 | case event.Key() == tcell.KeyCtrlB || event.Rune() == 'b': 36 | textview.ScrollTo(row-height, 0) 37 | return nil 38 | } 39 | return event 40 | }) 41 | 42 | // Callbacks 43 | textview.SetFocusFunc(func() { 44 | misc.PreviousPane = textview 45 | misc.SetActive(textview.Box, title, true) 46 | }) 47 | textview.SetBlurFunc(func() { 48 | misc.PreviousPane = textview 49 | misc.SetActive(textview.Box, title, false) 50 | }) 51 | 52 | return textview 53 | } 54 | -------------------------------------------------------------------------------- /core/tui/components/tui_textarea.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/tui/misc" 5 | "github.com/rivo/tview" 6 | ) 7 | 8 | func CreateTextArea(title string) *tview.TextArea { 9 | textarea := tview.NewTextArea() 10 | textarea.SetBorder(true) 11 | textarea.SetWrap(true) 12 | textarea.SetTitle(title) 13 | textarea.SetTitleAlign(misc.STYLE_TITLE.Align) 14 | textarea.SetTitleColor(misc.STYLE_DEFAULT.Fg) 15 | textarea.SetBackgroundColor(misc.STYLE_DEFAULT.Bg) 16 | textarea.SetBorderPadding(0, 0, 1, 1) 17 | 18 | // Callbacks 19 | textarea.SetFocusFunc(func() { 20 | misc.PreviousPane = textarea 21 | misc.SetActive(textarea.Box, title, true) 22 | }) 23 | textarea.SetBlurFunc(func() { 24 | misc.PreviousPane = textarea 25 | misc.SetActive(textarea.Box, title, false) 26 | }) 27 | 28 | return textarea 29 | } 30 | -------------------------------------------------------------------------------- /core/tui/components/tui_toggle_text.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/tui/misc" 5 | "github.com/gdamore/tcell/v2" 6 | "github.com/rivo/tview" 7 | ) 8 | 9 | type TToggleText struct { 10 | Value *string 11 | Option1 string 12 | Option2 string 13 | Label1 string 14 | Label2 string 15 | Data1 string 16 | Data2 string 17 | TextView *tview.TextView 18 | } 19 | 20 | func (t *TToggleText) Create() { 21 | textview := tview.NewTextView() 22 | textview.SetTitle("") 23 | if *t.Value == t.Option1 { 24 | textview.SetText(t.Label1) 25 | } else { 26 | textview.SetText(t.Label2) 27 | } 28 | textview.SetSize(1, 18) 29 | textview.SetBorder(false) 30 | textview.SetBorderPadding(0, 0, 0, 0) 31 | textview.SetBackgroundColor(misc.STYLE_ITEM.Bg) 32 | 33 | toggleOutput := func() { 34 | 35 | if *t.Value == t.Option1 { 36 | *t.Value = t.Option2 37 | textview.SetText(t.Label2) 38 | } else { 39 | *t.Value = t.Option1 40 | textview.SetText(t.Label1) 41 | } 42 | } 43 | 44 | textview.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { 45 | switch event.Key() { 46 | case tcell.KeyEnter: 47 | toggleOutput() 48 | return nil 49 | case tcell.KeyRune: 50 | switch event.Rune() { 51 | case ' ': // space 52 | toggleOutput() 53 | return nil 54 | } 55 | } 56 | 57 | return event 58 | }) 59 | 60 | textview.SetFocusFunc(func() { 61 | textview.SetTextColor(misc.STYLE_ITEM_FOCUSED.Fg) 62 | textview.SetBackgroundColor(misc.STYLE_ITEM_FOCUSED.Bg) 63 | }) 64 | 65 | textview.SetBlurFunc(func() { 66 | textview.SetTextColor(misc.STYLE_ITEM.Fg) 67 | textview.SetBackgroundColor(misc.STYLE_ITEM.Bg) 68 | }) 69 | 70 | t.TextView = textview 71 | } 72 | -------------------------------------------------------------------------------- /core/tui/misc/tui_event.go: -------------------------------------------------------------------------------- 1 | package misc 2 | 3 | import ( 4 | "sync" 5 | ) 6 | 7 | type Event struct { 8 | Name string 9 | Data interface{} 10 | } 11 | 12 | type EventListener func(Event) 13 | 14 | type EventEmitter struct { 15 | listeners map[string][]EventListener 16 | mu sync.RWMutex 17 | } 18 | 19 | func NewEventEmitter() *EventEmitter { 20 | return &EventEmitter{ 21 | listeners: make(map[string][]EventListener), 22 | } 23 | } 24 | 25 | func (ee *EventEmitter) Subscribe(eventName string, listener EventListener) { 26 | ee.mu.Lock() 27 | defer ee.mu.Unlock() 28 | ee.listeners[eventName] = append(ee.listeners[eventName], listener) 29 | } 30 | 31 | func (ee *EventEmitter) Publish(event Event) { 32 | ee.mu.RLock() 33 | defer ee.mu.RUnlock() 34 | if listeners, ok := ee.listeners[event.Name]; ok { 35 | for _, listener := range listeners { 36 | go listener(event) 37 | } 38 | } 39 | } 40 | 41 | func (ee *EventEmitter) PublishAndWait(event Event) { 42 | ee.mu.RLock() 43 | listeners := ee.listeners[event.Name] 44 | ee.mu.RUnlock() 45 | 46 | var wg sync.WaitGroup 47 | for _, listener := range listeners { 48 | wg.Add(1) 49 | go func(l EventListener) { 50 | defer wg.Done() 51 | l(event) 52 | }(listener) 53 | } 54 | wg.Wait() 55 | } 56 | -------------------------------------------------------------------------------- /core/tui/misc/tui_global.go: -------------------------------------------------------------------------------- 1 | package misc 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/dao" 5 | "github.com/rivo/tview" 6 | ) 7 | 8 | var Config *dao.Config 9 | var ThemeName *string 10 | var TUITheme *dao.TUI 11 | var BlockTheme *dao.Block 12 | 13 | var App *tview.Application 14 | var Pages *tview.Pages 15 | var MainPage *tview.Pages 16 | var PreviousPane tview.Primitive 17 | 18 | var PreviousModel interface{} 19 | 20 | // Nav 21 | var ProjectBtn *tview.Button 22 | var TaskBtn *tview.Button 23 | var RunBtn *tview.Button 24 | var ExecBtn *tview.Button 25 | var HelpBtn *tview.Button 26 | 27 | var ProjectsLastFocus *tview.Primitive 28 | var TasksLastFocus *tview.Primitive 29 | var RunLastFocus *tview.Primitive 30 | var ExecLastFocus *tview.Primitive 31 | 32 | // Misc 33 | var HelpModal *tview.Modal 34 | var Search *tview.InputField 35 | -------------------------------------------------------------------------------- /core/tui/misc/tui_utils.go: -------------------------------------------------------------------------------- 1 | package misc 2 | 3 | import ( 4 | "github.com/alajmo/mani/core/dao" 5 | "github.com/alajmo/mani/core/print" 6 | "github.com/rivo/tview" 7 | "golang.org/x/term" 8 | ) 9 | 10 | func SetActive(box *tview.Box, title string, active bool) { 11 | if active { 12 | box.SetBorderColor(STYLE_BORDER_FOCUS.Fg) 13 | box.SetTitleAlign(STYLE_TITLE_ACTIVE.Align) 14 | title = dao.StyleFormat(title, STYLE_TITLE_ACTIVE.FormatStr) 15 | if title != "" { 16 | title = ColorizeTitle(title, *TUITheme.TitleActive) 17 | box.SetTitle(title) 18 | } 19 | } else { 20 | box.SetBorderColor(STYLE_BORDER.Fg) 21 | box.SetTitleAlign(STYLE_TITLE.Align) 22 | title = dao.StyleFormat(title, STYLE_TITLE.FormatStr) 23 | if title != "" { 24 | title = ColorizeTitle(title, *TUITheme.Title) 25 | box.SetTitle(title) 26 | } 27 | } 28 | } 29 | 30 | func GetTexztModalSize(text string) (int, int) { 31 | termWidth, termHeight, _ := term.GetSize(0) 32 | textWidth, textHeight := print.GetTextDimensions(text) 33 | 34 | width := textWidth 35 | height := textHeight 36 | 37 | // Min Width - sane minimum default width 38 | if width < 45 { 39 | width = 45 40 | } 41 | 42 | // Max Width - can't be wider than terminal width 43 | if width > termWidth { 44 | width = termWidth - 20 // Add some margin left/right 45 | height = height + 4 // Since text wraps, add some margin to height 46 | } 47 | 48 | // Max Height - can't be taller than terminal width 49 | if height > termHeight { 50 | height = termHeight - 5 // Add some margin top/bottom 51 | } 52 | 53 | width += 8 // Add some padding 54 | height += 2 // Add some padding 55 | 56 | return width, height 57 | } 58 | -------------------------------------------------------------------------------- /core/tui/misc/tui_writer.go: -------------------------------------------------------------------------------- 1 | package misc 2 | 3 | import ( 4 | "io" 5 | "sync" 6 | 7 | "github.com/rivo/tview" 8 | ) 9 | 10 | // ThreadSafeWriter wraps a tview.ANSIWriter to make it thread-safe 11 | type ThreadSafeWriter struct { 12 | writer io.Writer 13 | mutex sync.Mutex 14 | } 15 | 16 | // NewThreadSafeWriter creates a new thread-safe writer for tview 17 | func NewThreadSafeWriter(view *tview.TextView) *ThreadSafeWriter { 18 | return &ThreadSafeWriter{ 19 | writer: tview.ANSIWriter(view), 20 | } 21 | } 22 | 23 | // Write implements io.Writer interface in a thread-safe manner 24 | func (w *ThreadSafeWriter) Write(p []byte) (n int, err error) { 25 | w.mutex.Lock() 26 | defer w.mutex.Unlock() 27 | return w.writer.Write(p) 28 | } 29 | -------------------------------------------------------------------------------- /core/tui/tui.go: -------------------------------------------------------------------------------- 1 | package tui 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/alajmo/mani/core" 7 | "github.com/alajmo/mani/core/dao" 8 | "github.com/alajmo/mani/core/tui/misc" 9 | "github.com/rivo/tview" 10 | ) 11 | 12 | func RunTui(config *dao.Config, themeName string, reload bool) { 13 | app := NewApp(config, themeName) 14 | 15 | if reload { 16 | WatchFiles(app, append([]string{config.Path}, config.ConfigPaths...)...) 17 | } 18 | 19 | if err := app.Run(); err != nil { 20 | os.Exit(1) 21 | } 22 | } 23 | 24 | type App struct { 25 | App *tview.Application 26 | } 27 | 28 | func NewApp(config *dao.Config, themeName string) *App { 29 | app := &App{ 30 | App: tview.NewApplication(), 31 | } 32 | app.setupApp(config, themeName) 33 | 34 | return app 35 | } 36 | 37 | func (a *App) Run() error { 38 | return a.App.SetRoot(misc.Pages, true).EnableMouse(true).Run() 39 | } 40 | 41 | func (app *App) Reload() { 42 | config, configErr := dao.ReadConfig(misc.Config.Path, "", true) 43 | if configErr != nil { 44 | app.App.Stop() 45 | } 46 | 47 | app.setupApp(&config, *misc.ThemeName) 48 | app.App.SetRoot(misc.Pages, true) 49 | app.App.Draw() 50 | } 51 | 52 | func (app *App) setupApp(config *dao.Config, themeName string) { 53 | misc.Config = config 54 | misc.ThemeName = &themeName 55 | theme, err := misc.Config.GetTheme(themeName) 56 | core.CheckIfError(err) 57 | 58 | misc.LoadStyles(&theme.TUI) 59 | misc.TUITheme = &theme.TUI 60 | misc.BlockTheme = &theme.Block 61 | 62 | // Data 63 | projects := config.ProjectList 64 | tasks := config.TaskList 65 | dao.ParseTasksEnv(tasks) 66 | projectTags := config.GetTags() 67 | projectPaths := config.GetProjectPaths() 68 | 69 | // Styles 70 | setupStyles() 71 | 72 | // Create pages 73 | misc.App = app.App 74 | misc.Pages = createPages(projects, projectTags, projectPaths, tasks) 75 | 76 | // Global input handling 77 | HandleInput(app) 78 | } 79 | -------------------------------------------------------------------------------- /core/tui/watcher.go: -------------------------------------------------------------------------------- 1 | package tui 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | "time" 7 | 8 | "github.com/fsnotify/fsnotify" 9 | ) 10 | 11 | func WatchFiles(app *App, files ...string) { 12 | if len(files) < 1 { 13 | return 14 | } 15 | 16 | w, err := fsnotify.NewWatcher() 17 | if err != nil { 18 | os.Exit(1) 19 | } 20 | 21 | go func() { 22 | defer w.Close() 23 | for _, p := range files { 24 | st, err := os.Lstat(p) 25 | if err != nil { 26 | os.Exit(1) 27 | } 28 | if st.IsDir() { 29 | os.Exit(1) 30 | } 31 | err = w.Add(filepath.Dir(p)) 32 | if err != nil { 33 | os.Exit(1) 34 | } 35 | } 36 | 37 | lastMod := make(map[string]time.Time) 38 | for { 39 | select { 40 | case _, ok := <-w.Errors: 41 | if !ok { 42 | return 43 | } 44 | os.Exit(1) 45 | case e, ok := <-w.Events: 46 | if !ok { 47 | return 48 | } 49 | 50 | for _, f := range files { 51 | if f == e.Name { 52 | stat, err := os.Stat(f) 53 | if err != nil { 54 | continue 55 | } 56 | 57 | currentMod := stat.ModTime() 58 | if lastMod[f] != currentMod { 59 | // TODO: For some reason, the reload is not working correctly, must be due to it being called in a goroutine 60 | // Sleeping resolves it somehow. 61 | time.Sleep(500 * time.Millisecond) 62 | app.Reload() 63 | lastMod[f] = currentMod 64 | } 65 | break 66 | } 67 | } 68 | } 69 | } 70 | }() 71 | } 72 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | All contributions are welcome, be it [filing bugs](https://github.com/alajmo/mani/issues), feature suggestions or helping developing `mani`. 4 | -------------------------------------------------------------------------------- /docs/error-handling.md: -------------------------------------------------------------------------------- 1 | # Error Handling 2 | 3 | ## Ignoring Task Errors 4 | 5 | If you wish to continue task execution even if an error is encountered, use the flag `--ignore-errors` or specify it in the task `spec`. 6 | 7 | - `ignore-errors` set to false 8 | 9 | ```bash 10 | $ mani run task-1 task-2 --all --ignore-errors=false 11 | Project | Task-1 | Task-2 12 | ------------+---------------+-------- 13 | project-0 | | 14 | | exit status 1 | 15 | ------------+---------------+-------- 16 | project-1 | | 17 | | exit status 1 | 18 | ------------+---------------+-------- 19 | project-2 | | 20 | | exit status 1 | 21 | ``` 22 | 23 | - `ignore-errors` set to true 24 | ```bash 25 | Project | Task-1 | Task-2 26 | ------------+---------------+-------- 27 | project-0 | | bar 28 | | exit status 1 | 29 | ------------+---------------+-------- 30 | project-1 | | bar 31 | | exit status 1 | 32 | ------------+---------------+-------- 33 | project-2 | | bar 34 | | exit status 1 | 35 | ``` 36 | 37 | ## Ignoring Non Existing Project 38 | 39 | - `--ignore-non-existing` set to false 40 | 41 | ```bash 42 | $ mani run task-1 --all 43 | error: path `/home/test/project-1` does not exist 44 | ``` 45 | 46 | - `ignore-unreachable` set to true 47 | ```bash 48 | $ mani run task-1 --all --ignore-non-existing 49 | Project | Task-1 50 | ------------+-------- 51 | project-0 | hello 52 | ------------+-------- 53 | project-1 | 54 | ------------+-------- 55 | project-2 | hello 56 | ``` 57 | -------------------------------------------------------------------------------- /docs/filtering-projects.md: -------------------------------------------------------------------------------- 1 | # Filtering Projects 2 | 3 | Projects can be filtered when managing projects (sync, list, describe) or running tasks. Filters can be specified through CLI flags or target configurations. The filtering is inclusive, meaning projects must satisfy all specified filters to be included in the results. 4 | 5 | Available options: 6 | 7 | - **cwd**: include only the project under the current working directory, ignoring all other filters 8 | - **all**: include all projects 9 | - **projects**: Filter by project names 10 | - **paths**: Filter by project paths 11 | - **tags**: Filter by project tags 12 | - **tags_expr**: Filter using tag logic expressions 13 | - **target**: Filter using target 14 | 15 | For `mani sync/list/describe`: 16 | 17 | - No filters: Targets all projects 18 | - Multiple filters: Select intersection of `projects/paths/tags/tags_expr/target` filters 19 | 20 | For `mani run/exec` the precedence is: 21 | 22 | 1. Runtime flags (highest priority) 23 | 2. Target flag configuration (`--target`) 24 | 3. Task's default target data (lowest priority) 25 | 26 | The default target is named `default` and can be overridden by defining a target named `default` in the config. This only applies for sub-commands `run` and `exec`. 27 | 28 | ## Tags Expression 29 | 30 | Tag expressions allow filtering projects using boolean operations on their tags. 31 | The expression is evaluated for each project's tags to determine if the project should be included. 32 | 33 | Operators (in precedence order): 34 | 35 | - (): Parentheses for grouping 36 | - !: NOT operator (logical negation) 37 | - &&: AND operator (logical conjunction) 38 | - ||: OR operator (logical disjunction) 39 | 40 | For example, the expression: 41 | 42 | - (main && (dev || prod)) && !test 43 | 44 | requires the projects to pass these conditions: 45 | 46 | - Must have "main" tag 47 | - Must have either "dev" OR "prod" tag 48 | - Must NOT have "test" tag 49 | -------------------------------------------------------------------------------- /docs/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | `mani` is available on Linux and Mac, with partial support for Windows. 4 | 5 | * Binaries are available on the [release](https://github.com/alajmo/mani/releases) page 6 | 7 | * via cURL (Linux & macOS) 8 | ```bash 9 | curl -sfL https://raw.githubusercontent.com/alajmo/mani/main/install.sh | sh 10 | ``` 11 | 12 | * via Homebrew 13 | ```bash 14 | brew tap alajmo/mani 15 | brew install mani 16 | ``` 17 | 18 | * via Arch 19 | ```sh 20 | pacman -S mani 21 | ``` 22 | 23 | * via Nix 24 | ```sh 25 | nix-env -iA nixos.mani 26 | ``` 27 | 28 | * via Go 29 | ```bash 30 | go get -u github.com/alajmo/mani 31 | ``` 32 | 33 | ## Building From Source 34 | 35 | 1. Clone the repo 36 | 2. Build and run the executable 37 | 38 | ```bash 39 | make build && ./dist/mani 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/man-pages.md: -------------------------------------------------------------------------------- 1 | # Man Page 2 | 3 | Man page generation is available via: 4 | 5 | ```bash 6 | $ mani gen 7 | Created mani.1 8 | 9 | # Or specify a different directory 10 | $ mani gen --dir /usr/local/share/man/man1/ 11 | Created /usr/local/share/man/man1/mani.1 12 | ``` 13 | -------------------------------------------------------------------------------- /docs/roadmap.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | `mani` is under active development. Before **v1.0.0**, I want to finish the following tasks: 4 | 5 | - [ ] Bring changes from `sake` 6 | - Refactor import logic and support recursive nesting of tasks 7 | - Add new table format output (tasks in 1st column, output in 2nd, one table per project) 8 | - [ ] Allow user to edit mani config from command line or TUI 9 | -------------------------------------------------------------------------------- /docs/shell-completion.mdx: -------------------------------------------------------------------------------- 1 | # Shell Completion 2 | 3 | Shell completion is available for `bash`, `zsh`, `fish` and `powershell`. 4 | 5 | import Tabs from '@theme/Tabs'; 6 | import TabItem from '@theme/TabItem'; 7 | 8 | 17 | 18 | 19 | 20 | ```bash 21 | mani completion bash 22 | ``` 23 | 24 | 25 | 26 | 27 | 28 | ```bash 29 | mani completion zsh 30 | ``` 31 | 32 | 33 | 34 | 35 | 36 | ```bash 37 | mani completion fish 38 | ``` 39 | 40 | 41 | 42 | 43 | 44 | ```bash 45 | mani completion powershell 46 | ``` 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /docs/usage.md: -------------------------------------------------------------------------------- 1 | # Usage 2 | 3 | ## Create a New Mani Repository 4 | 5 | Run the following command inside a directory containing your `git` repositories: 6 | 7 | ```bash 8 | $ mani init 9 | ``` 10 | 11 | This will generate **two** files: 12 | 13 | - `mani.yaml`: Contains projects and custom tasks. Any subdirectory that has a `.git` directory will be included (add the flag `--auto-discovery=false` to turn off this feature) 14 | - `.gitignore`: Includes the projects specified in `mani.yaml` file. To opt out, use `mani init --vcs=none`. 15 | 16 | It can be helpful to initialize the `mani` repository as a git repository so that anyone can easily download the `mani` repository and run `mani` sync to clone all repositories and get the same project setup as you. 17 | 18 | ## Run Some Commands 19 | 20 | ```bash 21 | # List all projects 22 | $ mani list projects 23 | 24 | # Count number of files in each project in parallel 25 | $ mani exec --all --output table --parallel 'find . -type f | wc -l' 26 | ``` 27 | 28 | Next up: 29 | 30 | - [Some more examples](/examples) 31 | - [Familiarize yourself with the mani.yaml config](/config) 32 | - [Checkout mani commands](/commands) 33 | -------------------------------------------------------------------------------- /docs/variables.md: -------------------------------------------------------------------------------- 1 | # Variables 2 | 3 | `mani` supports setting variables for both projects and tasks. Variables can be either strings or commands (encapsulated by $()) that will be evaluated once for each task. 4 | 5 | ```yaml 6 | projects: 7 | pinto: 8 | path: pinto 9 | url: https://github.com/alajmo/pinto.git 10 | env: 11 | foo: bar 12 | 13 | tasks: 14 | ping: 15 | cmd: | 16 | echo "$msg" 17 | echo "$date" 18 | echo "$foo" 19 | env: 20 | msg: text 21 | date: $(date) 22 | ``` 23 | 24 | ## Pass Variables from CLI 25 | 26 | To pass variables from the command line, provide them as arguments. For example: 27 | 28 | ```bash 29 | mani run msg option=123 30 | ``` 31 | 32 | The environment variable option will then be available for use within the task. 33 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | # mani # 2 | template-generator 3 | frontend/pinto 4 | # mani # 5 | -------------------------------------------------------------------------------- /examples/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | desc: A mani example 5 | 6 | pinto: 7 | path: frontend/pinto 8 | url: https://github.com/alajmo/pinto.git 9 | desc: A vim theme editor 10 | tags: [frontend, node] 11 | 12 | template-generator: 13 | url: https://github.com/alajmo/template-generator.git 14 | desc: A simple bash script used to manage boilerplates 15 | tags: [cli, bash] 16 | env: 17 | branch: dev 18 | 19 | specs: 20 | custom: 21 | output: table 22 | parallel: true 23 | 24 | targets: 25 | all: 26 | all: true 27 | 28 | themes: 29 | custom: 30 | table: 31 | border: 32 | around: true 33 | columns: true 34 | header: true 35 | rows: true 36 | 37 | tasks: 38 | git-status: 39 | desc: show working tree status 40 | spec: custom 41 | target: all 42 | cmd: git status 43 | 44 | git-last-commit-msg: 45 | desc: show last commit 46 | cmd: git log -1 --pretty=%B 47 | 48 | git-last-commit-date: 49 | desc: show last commit date 50 | cmd: | 51 | git log -1 --format="%cd (%cr)" -n 1 --date=format:"%d %b %y" \ 52 | | sed 's/ //' 53 | 54 | git-branch: 55 | desc: show current git branch 56 | cmd: git rev-parse --abbrev-ref HEAD 57 | 58 | npm-install: 59 | desc: run npm install in node repos 60 | target: 61 | tags: [node] 62 | cmd: npm install 63 | 64 | git-overview: 65 | desc: show branch, local and remote diffs, last commit and date 66 | spec: custom 67 | target: all 68 | theme: custom 69 | commands: 70 | - task: git-branch 71 | - task: git-last-commit-msg 72 | - task: git-last-commit-date 73 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/alajmo/mani 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.23.1 6 | 7 | require ( 8 | github.com/fsnotify/fsnotify v1.8.0 9 | github.com/gdamore/tcell/v2 v2.8.1 10 | github.com/gookit/color v1.5.4 11 | github.com/jedib0t/go-pretty/v6 v6.6.7 12 | github.com/jinzhu/copier v0.4.0 13 | github.com/kr/pretty v0.2.1 14 | github.com/otiai10/copy v1.6.0 15 | github.com/rivo/tview v0.0.0-20250322200051-73a5bd7d6839 16 | github.com/spf13/cobra v1.9.1 17 | github.com/spf13/pflag v1.0.6 18 | github.com/theckman/yacspin v0.13.12 19 | golang.org/x/sys v0.31.0 20 | golang.org/x/term v0.30.0 21 | golang.org/x/text v0.23.0 22 | gopkg.in/yaml.v3 v3.0.1 23 | ) 24 | 25 | require ( 26 | github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect 27 | github.com/fatih/color v1.18.0 // indirect 28 | github.com/gdamore/encoding v1.0.1 // indirect 29 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 30 | github.com/kr/text v0.2.0 // indirect 31 | github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 32 | github.com/mattn/go-colorable v0.1.14 // indirect 33 | github.com/mattn/go-isatty v0.0.20 // indirect 34 | github.com/mattn/go-runewidth v0.0.16 // indirect 35 | github.com/rivo/uniseg v0.4.7 // indirect 36 | github.com/russross/blackfriday/v2 v2.1.0 // indirect 37 | github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect 38 | gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect 39 | ) 40 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/alajmo/mani/cmd" 5 | ) 6 | 7 | func main() { 8 | cmd.Execute() 9 | } 10 | -------------------------------------------------------------------------------- /res/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/res/demo.gif -------------------------------------------------------------------------------- /res/demo.md: -------------------------------------------------------------------------------- 1 | # Demo 2 | 3 | To generate a `demo.gif` use [vhs](https://github.com/charmbracelet/vhs). 4 | 5 | Requires: 6 | 7 | - ffmpeg 8 | - ttyd 9 | 10 | ``` 11 | # Stand in mani/res 12 | vhs demo.gif 13 | ``` 14 | 15 | To update `demo.gif`, modify `demo.vhs`. 16 | -------------------------------------------------------------------------------- /res/demo.vhs: -------------------------------------------------------------------------------- 1 | Output demo.gif 2 | 3 | Set FontSize 28 4 | Set Width 1920 5 | Set Height 1080 6 | 7 | Sleep 500ms 8 | Type "mani sync" 9 | Enter 10 | Sleep 2000ms 11 | 12 | Type "mani tui" 13 | Sleep 2000ms 14 | Enter 15 | 16 | # Select task 17 | Sleep 1000ms 18 | Type "G" 19 | Sleep 2000ms 20 | Space 21 | 22 | # Filter tags 23 | Type "3" 24 | Sleep 2000ms 25 | Space 26 | 27 | # Select project 28 | Type "2" 29 | Sleep 1000ms 30 | Type "a" 31 | 32 | # Run 33 | Sleep 2000ms 34 | Ctrl+R 35 | 36 | Sleep 4s 37 | -------------------------------------------------------------------------------- /res/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/res/logo.png -------------------------------------------------------------------------------- /res/mani.yaml: -------------------------------------------------------------------------------- 1 | reload_tui_on_change: true 2 | sync_remotes: true 3 | 4 | projects: 5 | projects: 6 | path: . 7 | 8 | mani: 9 | path: go/mani 10 | url: https://github.com/alajmo/mani.git 11 | remotes: 12 | foo: https://github.com/alajmo/mani.git 13 | bar: https://github.com/alajmo/mani.git 14 | tags: [git, mani] 15 | 16 | sake: 17 | path: go/sake 18 | url: https://github.com/alajmo/sake.git 19 | tags: [git, sake] 20 | 21 | tasks: 22 | current-branch: 23 | desc: print current branch 24 | cmd: git branch 25 | 26 | num-branches: 27 | desc: 'print # branches' 28 | cmd: git branch | wc -l 29 | 30 | num-commits: 31 | desc: 'print # commits' 32 | cmd: git rev-list --all --count 33 | 34 | num-authors: 35 | desc: 'print # authors' 36 | cmd: git shortlog -s -n --all --no-merges | wc -l 37 | 38 | print-overview: 39 | desc: 'show # commits, # branches, # authors, last commit date' 40 | commands: 41 | - task: current-branch 42 | - task: num-branches 43 | - task: num-commits 44 | - task: num-authors 45 | -------------------------------------------------------------------------------- /scripts/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | # Get latest version changes only 6 | sed '0,/## v/d;/## v/Q' docs/changelog.md | tail -n +2 | head -n-1 > release-changelog.md 7 | -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- 1 | # Test 2 | 3 | `mani` currently only has integration tests, which require `docker` to run. This is because `mani` mainly interacts with the filesystem, and whilst there are ways to mock the filesystem, it's simply easier (and fast enough) to spin up a `docker` container and do the work there. 4 | 5 | The tests are based on something called "golden files", which are the expected output of the tests. It serves the benefit of working as documentation as well, since it becomes easy to see the desired output of the different `mani` commands. 6 | 7 | There's some helpful scripts in the `scripts` directory that can be used to test and debug `mani`. These scripts should be run from the project directory. 8 | 9 | The Docker test container includes a script `git` which only creates the project directories, it doesn't clone the actual repositories. 10 | 11 | ## Directory Structure 12 | 13 | ```sh 14 | . 15 | ├── fixtures # files needed for testing purposes 16 | ├── images # docker images used for testing and development 17 | ├── integration # integration tests and golden files 18 | ├── scripts # scripts for development and testing 19 | └── tmp # docker mounted volume that you can preview test output 20 | ``` 21 | 22 | ## Prerequisites 23 | 24 | - [docker](https://docs.docker.com/get-docker/) 25 | - [golangci-lint](https://golangci-lint.run/usage/install/) 26 | 27 | ## Testing & Development 28 | 29 | Checkout the below commands and the [Makefile](../Makefile) to test/debug `mani`. 30 | 31 | ```sh 32 | # Run tests 33 | ./test/scripts/test 34 | 35 | # Run specific tests, print stdout and build mani 36 | ./test/scripts/test --debug --build --run TestInitCmd 37 | 38 | # Update Golden Files 39 | ./test/scripts/test -u 40 | 41 | # Start an interactive shell inside docker 42 | ./test/scripts/exec --shell bash|zsh|fish 43 | 44 | # Debug completion 45 | mani __complete list tags --projects "" 46 | 47 | # Stand in _example directory 48 | (cd ../ && make build-and-link && cd - && mani run status --cwd) 49 | ``` 50 | -------------------------------------------------------------------------------- /test/fixtures/mani-advanced/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/fixtures/mani-advanced/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/fixtures/mani-empty/mani.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/fixtures/mani-empty/mani.yaml -------------------------------------------------------------------------------- /test/fixtures/mani-no-tasks/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | tap-report: 6 | path: frontend/tap-report 7 | url: https://github.com/alajmo/tap-report 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | -------------------------------------------------------------------------------- /test/images/alpine.exec.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.18.0 as build 2 | 3 | ENV XDG_CACHE_HOME=/tmp/.cache 4 | ENV GOPATH=${HOME}/go 5 | ENV GO111MODULE=on 6 | ENV PATH="/usr/local/go/bin:${PATH}" 7 | ENV USER="test" 8 | ENV HOME="/home/test" 9 | 10 | COPY --from=golang:1.20.5-alpine /usr/local/go/ /usr/local/go/ 11 | 12 | RUN apk update 13 | RUN apk add --no-cache make build-base bash curl g++ git 14 | 15 | WORKDIR /opt 16 | 17 | COPY go.mod go.sum ./ 18 | RUN go mod download 19 | COPY . . 20 | RUN make build 21 | 22 | FROM alpine:3.15.4 23 | 24 | RUN apk update 25 | RUN apk add --no-cache sudo bash zsh fish bash-completion git 26 | 27 | COPY --from=build /opt/dist/mani /usr/local/bin/mani 28 | 29 | RUN mani completion bash > /usr/share/bash-completion/completions/mani 30 | 31 | RUN addgroup -g 1000 -S test && adduser -u 1000 -S test -G test 32 | USER test 33 | 34 | WORKDIR /home/test 35 | 36 | # Setup example directory 37 | COPY --chown=test --from=build /opt/examples/mani.yaml /home/test/ 38 | 39 | RUN echo 'fpath=( ~/.zsh/completion "${fpath[@]}" ); autoload -Uz compinit && compinit -i' > /home/test/.zshrc 40 | RUN mkdir -p /home/test/.zsh/completion ~/.config/fish/completions 41 | RUN mani completion zsh > /home/test/.zsh/completion/_mani 42 | RUN mani completion fish > ~/.config/fish/completions/mani.fish 43 | RUN echo 'source /etc/profile.d/bash_completion.sh' > /home/test/.bashrc 44 | -------------------------------------------------------------------------------- /test/images/alpine.test.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.21.0 2 | 3 | ENV GOCACHE=/go/cache 4 | ENV GO111MODULE=on 5 | ENV PATH="/usr/local/go/bin:${PATH}" 6 | ENV USER="test" 7 | ENV HOME="/home/test" 8 | 9 | COPY --from=golang:1.23.4-alpine /usr/local/go/ /usr/local/go/ 10 | 11 | RUN apk update 12 | RUN apk add --no-cache make build-base bash curl g++ git 13 | 14 | RUN addgroup -g 1000 -S test && adduser -u 1000 -S test -G test 15 | 16 | WORKDIR /home/test 17 | 18 | COPY --chown=test go.mod go.sum ./ 19 | RUN go mod download 20 | COPY --chown=test . . 21 | COPY --chown=test ./test/scripts/git /usr/local/bin/git 22 | RUN make build-test && cp /home/test/dist/mani /usr/local/bin/mani 23 | 24 | USER test 25 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-0/mani.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/describe/golden-0/mani.yaml -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Describe 0 projects when there's 0 projects 3 | WantErr: false 4 | Cmd: 5 | mani describe projects 6 | 7 | --- 8 | No matching projects found 9 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Describe 0 projects on non-existent tag 3 | WantErr: true 4 | Cmd: 5 | mani describe projects --tags lala 6 | 7 | --- 8 | error: cannot find tags `lala` 9 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-2/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-2/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 2 2 | Name: Describe 0 projects on 2 non-matching tags 3 | WantErr: false 4 | Cmd: 5 | mani describe projects --tags frontend,cli 6 | 7 | --- 8 | No matching projects found 9 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-3/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-3/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 3 2 | Name: Describe all projects 3 | WantErr: false 4 | Cmd: 5 | mani describe projects 6 | 7 | --- 8 | 9 | name: example 10 | sync: true 11 | path: . 12 | url: 13 | single_branch: false 14 | 15 | -- 16 | 17 | name: pinto 18 | sync: true 19 | path: frontend/pinto 20 | url: https://github.com/alajmo/pinto 21 | single_branch: false 22 | tags: frontend 23 | 24 | -- 25 | 26 | name: dashgrid 27 | sync: true 28 | path: frontend/dashgrid 29 | url: https://github.com/alajmo/dashgrid 30 | single_branch: false 31 | tags: frontend, misc 32 | 33 | -- 34 | 35 | name: template-generator 36 | sync: true 37 | url: https://github.com/alajmo/template-generator 38 | single_branch: false 39 | tags: cli 40 | env: 41 | branch: dev 42 | 43 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-4/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-4/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 4 2 | Name: Describe projects matching 1 tag 3 | WantErr: false 4 | Cmd: 5 | mani describe projects --tags frontend 6 | 7 | --- 8 | 9 | name: pinto 10 | sync: true 11 | path: frontend/pinto 12 | url: https://github.com/alajmo/pinto 13 | single_branch: false 14 | tags: frontend 15 | 16 | -- 17 | 18 | name: dashgrid 19 | sync: true 20 | path: frontend/dashgrid 21 | url: https://github.com/alajmo/dashgrid 22 | single_branch: false 23 | tags: frontend, misc 24 | 25 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-5/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-5/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 5 2 | Name: Describe projects matching multiple tags 3 | WantErr: false 4 | Cmd: 5 | mani describe projects --tags misc,frontend 6 | 7 | --- 8 | 9 | name: dashgrid 10 | sync: true 11 | path: frontend/dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | single_branch: false 14 | tags: frontend, misc 15 | 16 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-6/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-6/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 6 2 | Name: Describe 1 project 3 | WantErr: false 4 | Cmd: 5 | mani describe projects pinto 6 | 7 | --- 8 | 9 | name: pinto 10 | sync: true 11 | path: frontend/pinto 12 | url: https://github.com/alajmo/pinto 13 | single_branch: false 14 | tags: frontend 15 | 16 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-7/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | tap-report: 6 | path: frontend/tap-report 7 | url: https://github.com/alajmo/tap-report 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-7/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 7 2 | Name: Describe 0 tasks when no tasks exists 3 | WantErr: false 4 | Cmd: 5 | mani describe tasks 6 | 7 | --- 8 | No tasks 9 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-8/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-9/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/describe/golden-9/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 9 2 | Name: Describe 1 tasks 3 | WantErr: false 4 | Cmd: 5 | mani describe tasks status 6 | 7 | --- 8 | 9 | name: status 10 | description: 11 | theme: default 12 | target: 13 | all: false 14 | cwd: false 15 | projects: 16 | paths: 17 | tags: 18 | tags_expr: 19 | spec: 20 | output: stream 21 | parallel: false 22 | ignore_errors: false 23 | omit_empty_rows: false 24 | omit_empty_columns: false 25 | cmd: 26 | git status 27 | 28 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Should fail to exec when no configuration file found 3 | WantErr: true 4 | Cmd: 5 | mani exec --all -o table ls 6 | 7 | 8 | --- 9 | error: cannot find any configuration file [mani.yaml mani.yml .mani.yaml .mani.yml] in current directory or any of the parent directories 10 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-1/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-1/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Should exec in zero projects 3 | WantErr: true 4 | Cmd: 5 | mani sync 6 | mani exec -o table ls 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | error: no matching projects found 29 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-1/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-1/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-2/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-2/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 2 2 | Name: Should exec in all projects 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani exec --all -o table ls 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | output 30 | --------------------+-------------------- 31 | example | frontend 32 | | mani.yaml 33 | | template-generator 34 | --------------------+-------------------- 35 | pinto | empty 36 | --------------------+-------------------- 37 | dashgrid | empty 38 | --------------------+-------------------- 39 | template-generator | empty 40 | 41 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-2/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-2/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-3/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-3/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 3 2 | Name: Should exec when filtered on project name 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani exec -o table --projects pinto ls 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | output 30 | ---------+-------- 31 | pinto | empty 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-3/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-3/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-4/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-4/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 4 2 | Name: Should exec when filtered on tags 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani exec -o table --tags frontend ls 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | output 30 | ----------+-------- 31 | pinto | empty 32 | ----------+-------- 33 | dashgrid | empty 34 | 35 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-4/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-4/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-5/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-5/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 5 2 | Name: Should exec when filtered on cwd 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | cd template-generator 7 | mani exec -o table --cwd pwd 8 | 9 | 10 | --- 11 | 12 | Project [pinto] 13 | 14 | 15 | Project [dashgrid] 16 | 17 | 18 | Project [template-generator] 19 | 20 | 21 | 22 | Project | Synced 23 | --------------------+-------- 24 | example | ✓ 25 | pinto | ✓ 26 | dashgrid | ✓ 27 | template-generator | ✓ 28 | 29 | 30 | project | output 31 | --------------------+------------------------------------------------------------- 32 | template-generator | /home/test/test/tmp/golden/exec/golden-5/template-generator 33 | 34 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-5/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-5/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-6/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-6/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 6 2 | Name: Should dry run exec 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani exec -o table --dry-run --projects template-generator pwd 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | output 30 | --------------------+-------- 31 | template-generator | pwd 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/exec/golden-6/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/exec/golden-6/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/init/golden-0/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | golden-0: 3 | path: . 4 | 5 | tasks: 6 | hello: 7 | desc: Print Hello World 8 | cmd: echo "Hello World" 9 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Initialize mani in empty directory 3 | WantErr: false 4 | Cmd: 5 | mani init --color=false 6 | 7 | --- 8 | 9 | Initialized mani repository in /home/test/test/tmp/golden/init/golden-0 10 | - Created mani.yaml 11 | 12 | Following projects were added to mani.yaml 13 | 14 | Project | Path 15 | ----------+------ 16 | golden-0 | . 17 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/.gitignore: -------------------------------------------------------------------------------- 1 | # mani # 2 | tap-report 3 | nested/template-generator 4 | # mani # 5 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/init/golden-1/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | golden-1: 3 | path: . 4 | url: https://github.com/alajmo/pinto 5 | 6 | template-generator: 7 | path: nested/template-generator 8 | url: https://github.com/alajmo/template-generator 9 | 10 | tap-report: 11 | url: https://github.com/alajmo/tap-report 12 | 13 | tasks: 14 | hello: 15 | desc: Print Hello World 16 | cmd: echo "Hello World" 17 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/nameless/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/init/golden-1/nameless/empty -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/nested/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/init/golden-1/nested/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Initialize mani with auto-discovery 3 | WantErr: false 4 | Cmd: 5 | (mkdir -p dashgrid && touch dashgrid/empty); 6 | (mkdir -p tap-report && touch tap-report/empty && cd tap-report && git init -b main && git remote add origin https://github.com/alajmo/tap-report); 7 | (mkdir -p nested/template-generator && touch nested/template-generator/empty && cd nested/template-generator && git init -b main && git remote add origin https://github.com/alajmo/template-generator); 8 | (mkdir nameless && touch nameless/empty); 9 | (git init -b main && git remote add origin https://github.com/alajmo/pinto) 10 | mani init --color=false 11 | 12 | 13 | --- 14 | Initialized empty Git repository in /home/test/test/tmp/golden/init/golden-1/tap-report/.git/ 15 | Initialized empty Git repository in /home/test/test/tmp/golden/init/golden-1/nested/template-generator/.git/ 16 | Initialized empty Git repository in /home/test/test/tmp/golden/init/golden-1/.git/ 17 | 18 | Initialized mani repository in /home/test/test/tmp/golden/init/golden-1 19 | - Created mani.yaml 20 | - Created .gitignore 21 | 22 | Following projects were added to mani.yaml 23 | 24 | Project | Path 25 | --------------------+--------------------------- 26 | golden-1 | . 27 | template-generator | nested/template-generator 28 | tap-report | tap-report 29 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-1/tap-report/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/init/golden-1/tap-report/empty -------------------------------------------------------------------------------- /test/integration/golden/init/golden-2/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/init/golden-2/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 2 2 | Name: Throw error when initialize in existing mani directory 3 | WantErr: true 4 | Cmd: 5 | mani init --color=false 6 | 7 | --- 8 | error: `/home/test/test/tmp/golden/init/golden-2` is already a mani directory 9 | 10 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-0/mani.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/list/golden-0/mani.yaml -------------------------------------------------------------------------------- /test/integration/golden/list/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: List 0 projects 3 | WantErr: false 4 | Cmd: 5 | mani list projects 6 | 7 | --- 8 | No matching projects found 9 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: List 0 projects on non-existent tag 3 | WantErr: true 4 | Cmd: 5 | mani list projects --tags lala 6 | 7 | --- 8 | error: cannot find tags `lala` 9 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-10/mani.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/list/golden-10/mani.yaml -------------------------------------------------------------------------------- /test/integration/golden/list/golden-10/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 10 2 | Name: List empty projects tree 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tree 6 | 7 | --- 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-11/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-11/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 11 2 | Name: List full tree 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tree 6 | 7 | --- 8 | ┌─ . 9 | ├─ frontend 10 | │ ├─ pinto 11 | │ └─ dashgrid 12 | └─ template-generator 13 | 14 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-12/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-12/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 12 2 | Name: List tree filtered on tag 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tree --tags frontend 6 | 7 | --- 8 | ── frontend 9 | ├─ pinto 10 | └─ dashgrid 11 | 12 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-13/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-13/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 13 2 | Name: List all tags 3 | WantErr: false 4 | Cmd: 5 | mani list tags 6 | 7 | --- 8 | 9 | Tag | Project 10 | ----------+-------------------- 11 | frontend | pinto 12 | | dashgrid 13 | misc | dashgrid 14 | cli | template-generator 15 | 16 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-14/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-14/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 14 2 | Name: List two tags 3 | WantErr: false 4 | Cmd: 5 | mani list tags frontend misc 6 | 7 | --- 8 | 9 | Tag | Project 10 | ----------+---------- 11 | frontend | pinto 12 | | dashgrid 13 | misc | dashgrid 14 | 15 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-15/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | tap-report: 6 | path: frontend/tap-report 7 | url: https://github.com/alajmo/tap-report 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-15/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 15 2 | Name: List 0 tasks when no tasks exists 3 | WantErr: false 4 | Cmd: 5 | mani list tasks 6 | 7 | --- 8 | No tasks 9 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-16/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-16/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 16 2 | Name: List all tasks 3 | WantErr: false 4 | Cmd: 5 | mani list tasks 6 | 7 | --- 8 | 9 | Task | Description 10 | ------------------+---------------- 11 | fetch | Fetch git 12 | status | 13 | checkout | 14 | create-branch | 15 | multi | 16 | default-tags | 17 | default-projects | 18 | default-output | 19 | pwd | 20 | submarine | Submarine test 21 | 22 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-17/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-17/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 17 2 | Name: List two args 3 | WantErr: false 4 | Cmd: 5 | mani list tasks fetch status 6 | 7 | --- 8 | 9 | Task | Description 10 | --------+------------- 11 | fetch | Fetch git 12 | status | 13 | 14 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-2/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-2/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 2 2 | Name: List 0 projects on 2 non-matching tags 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tags frontend,cli 6 | 7 | --- 8 | No matching projects found 9 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-3/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-3/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 3 2 | Name: List multiple projects 3 | WantErr: false 4 | Cmd: 5 | mani list projects 6 | 7 | --- 8 | 9 | Project | Tag 10 | --------------------+---------------- 11 | example | 12 | pinto | frontend 13 | dashgrid | frontend, misc 14 | template-generator | cli 15 | 16 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-4/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-4/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 4 2 | Name: List only project names and no description/tags 3 | WantErr: false 4 | Cmd: 5 | mani list projects --output table --headers project 6 | 7 | --- 8 | 9 | Project 10 | -------------------- 11 | example 12 | pinto 13 | dashgrid 14 | template-generator 15 | 16 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-5/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-5/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 5 2 | Name: List projects matching 1 tag 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tags frontend 6 | 7 | --- 8 | 9 | Project | Tag 10 | ----------+---------------- 11 | pinto | frontend 12 | dashgrid | frontend, misc 13 | 14 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-6/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-6/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 6 2 | Name: List projects matching multiple tags 3 | WantErr: false 4 | Cmd: 5 | mani list projects --tags misc,frontend 6 | 7 | --- 8 | 9 | Project | Tag 10 | ----------+---------------- 11 | dashgrid | frontend, misc 12 | 13 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-7/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-7/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 7 2 | Name: List two projects 3 | WantErr: false 4 | Cmd: 5 | mani list projects pinto dashgrid 6 | 7 | --- 8 | 9 | Project | Tag 10 | ----------+---------------- 11 | pinto | frontend 12 | dashgrid | frontend, misc 13 | 14 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-8/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-8/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 8 2 | Name: List projects matching 1 dir 3 | WantErr: false 4 | Cmd: 5 | mani list projects --paths frontend 6 | 7 | --- 8 | 9 | Project | Tag 10 | ----------+---------------- 11 | pinto | frontend 12 | dashgrid | frontend, misc 13 | 14 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-9/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/list/golden-9/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 9 2 | Name: List 0 projects with no matching paths 3 | WantErr: true 4 | Cmd: 5 | mani list projects --paths hello 6 | 7 | --- 8 | error: cannot find paths `hello` 9 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Should fail to run when no configuration file found 3 | WantErr: true 4 | Cmd: 5 | mani run pwd --all 6 | 7 | 8 | --- 9 | error: cannot find any configuration file [mani.yaml mani.yml .mani.yaml .mani.yml] in current directory or any of the parent directories 10 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-1/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-1/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Should run in zero projects 3 | WantErr: true 4 | Cmd: 5 | mani sync 6 | mani run pwd -o table 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | error: no matching projects found 29 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-1/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-1/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-10/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-10/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 10 2 | Name: Should run multiple commands 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run pwd multi -o table --all 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | pwd | multi 30 | --------------------+-------------------------------------------------------------+----------- 31 | example | /home/test/test/tmp/golden/run/golden-10 | 1st line 32 | | | 2nd line 33 | --------------------+-------------------------------------------------------------+----------- 34 | pinto | /home/test/test/tmp/golden/run/golden-10/frontend/pinto | 1st line 35 | | | 2nd line 36 | --------------------+-------------------------------------------------------------+----------- 37 | dashgrid | /home/test/test/tmp/golden/run/golden-10/frontend/dashgrid | 1st line 38 | | | 2nd line 39 | --------------------+-------------------------------------------------------------+----------- 40 | template-generator | /home/test/test/tmp/golden/run/golden-10/template-generator | 1st line 41 | | | 2nd line 42 | 43 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-10/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-10/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-11/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-11/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 11 2 | Name: Should run sub-commands 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run submarine --all 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | command-1 | command-2 | command-3 | pwd | submarine 30 | --------------------+-----------+-----------+-----------+-------------------------------------------------------------+----------- 31 | example | 1 | 2 | 3 | /home/test/test/tmp/golden/run/golden-11 | 0 32 | --------------------+-----------+-----------+-----------+-------------------------------------------------------------+----------- 33 | pinto | 1 | 2 | 3 | /home/test/test/tmp/golden/run/golden-11/frontend/pinto | 0 34 | --------------------+-----------+-----------+-----------+-------------------------------------------------------------+----------- 35 | dashgrid | 1 | 2 | 3 | /home/test/test/tmp/golden/run/golden-11/frontend/dashgrid | 0 36 | --------------------+-----------+-----------+-----------+-------------------------------------------------------------+----------- 37 | template-generator | 1 | 2 | 3 | /home/test/test/tmp/golden/run/golden-11/template-generator | 0 38 | 39 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-11/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-11/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-2/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-2/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 2 2 | Name: Should run in all projects 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run --all pwd 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | TASK [pwd] 30 | 31 | example | /home/test/test/tmp/golden/run/golden-2 32 | 33 | TASK [pwd] 34 | 35 | pinto | /home/test/test/tmp/golden/run/golden-2/frontend/pinto 36 | 37 | TASK [pwd] 38 | 39 | dashgrid | /home/test/test/tmp/golden/run/golden-2/frontend/dashgrid 40 | 41 | TASK [pwd] 42 | 43 | template-generator | /home/test/test/tmp/golden/run/golden-2/template-generator 44 | 45 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-2/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-2/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-3/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-3/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 3 2 | Name: Should run when filtered on project 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run -o table --projects pinto pwd 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | pwd 30 | ---------+-------------------------------------------------------- 31 | pinto | /home/test/test/tmp/golden/run/golden-3/frontend/pinto 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-3/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-3/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-4/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-4/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 4 2 | Name: Should run when filtered on tags 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run -o table --tags frontend pwd 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | pwd 30 | ----------+----------------------------------------------------------- 31 | pinto | /home/test/test/tmp/golden/run/golden-4/frontend/pinto 32 | ----------+----------------------------------------------------------- 33 | dashgrid | /home/test/test/tmp/golden/run/golden-4/frontend/dashgrid 34 | 35 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-4/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-4/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-5/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-5/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 5 2 | Name: Should run when filtered on cwd 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | cd template-generator 7 | mani run -o table --cwd pwd 8 | 9 | 10 | --- 11 | 12 | Project [pinto] 13 | 14 | 15 | Project [dashgrid] 16 | 17 | 18 | Project [template-generator] 19 | 20 | 21 | 22 | Project | Synced 23 | --------------------+-------- 24 | example | ✓ 25 | pinto | ✓ 26 | dashgrid | ✓ 27 | template-generator | ✓ 28 | 29 | 30 | project | pwd 31 | --------------------+------------------------------------------------------------ 32 | template-generator | /home/test/test/tmp/golden/run/golden-5/template-generator 33 | 34 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-5/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-5/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-6/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-6/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 6 2 | Name: Should run on default tags 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run -o table default-tags 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | default-tags 30 | ----------+----------------------------------------------------------- 31 | pinto | /home/test/test/tmp/golden/run/golden-6/frontend/pinto 32 | ----------+----------------------------------------------------------- 33 | dashgrid | /home/test/test/tmp/golden/run/golden-6/frontend/dashgrid 34 | 35 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-6/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-6/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-7/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-7/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 7 2 | Name: Should run on default projects 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run -o table default-projects 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | default-projects 30 | ----------+----------------------------------------------------------- 31 | dashgrid | /home/test/test/tmp/golden/run/golden-7/frontend/dashgrid 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-7/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-7/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-8/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-8/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 8 2 | Name: Should print table when output set to table in task 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run default-output -p dashgrid 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | default-output 30 | ----------+----------------------------------------------------------- 31 | dashgrid | /home/test/test/tmp/golden/run/golden-8/frontend/dashgrid 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-8/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-8/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-9/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-9/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 9 2 | Name: Should dry run 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | mani run --dry-run --projects template-generator -o table pwd 7 | 8 | 9 | --- 10 | 11 | Project [pinto] 12 | 13 | 14 | Project [dashgrid] 15 | 16 | 17 | Project [template-generator] 18 | 19 | 20 | 21 | Project | Synced 22 | --------------------+-------- 23 | example | ✓ 24 | pinto | ✓ 25 | dashgrid | ✓ 26 | template-generator | ✓ 27 | 28 | 29 | project | pwd 30 | --------------------+----- 31 | template-generator | pwd 32 | 33 | -------------------------------------------------------------------------------- /test/integration/golden/run/golden-9/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/run/golden-9/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Throw error when trying to sync a non-existing mani repository 3 | WantErr: true 4 | Cmd: 5 | mani sync 6 | 7 | 8 | --- 9 | error: cannot find any configuration file [mani.yaml mani.yml .mani.yaml .mani.yml] in current directory or any of the parent directories 10 | -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/.gitignore: -------------------------------------------------------------------------------- 1 | outside 2 | 3 | # mani # 4 | template-generator 5 | frontend/dashgrid 6 | frontend/pinto 7 | # mani # 8 | 9 | outside 10 | frontend/pinto-vim 11 | -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/frontend/dashgrid/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/sync/golden-1/frontend/dashgrid/empty -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/frontend/pinto/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/sync/golden-1/frontend/pinto/empty -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Should sync 3 | WantErr: false 4 | Cmd: 5 | mani sync 6 | 7 | 8 | --- 9 | 10 | Project [pinto] 11 | 12 | 13 | Project [dashgrid] 14 | 15 | 16 | Project [template-generator] 17 | 18 | 19 | 20 | Project | Synced 21 | --------------------+-------- 22 | example | ✓ 23 | pinto | ✓ 24 | dashgrid | ✓ 25 | template-generator | ✓ 26 | 27 | -------------------------------------------------------------------------------- /test/integration/golden/sync/golden-1/template-generator/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alajmo/mani/73aa308625dd58f27a7a5b79d7874493acdeddeb/test/integration/golden/sync/golden-1/template-generator/empty -------------------------------------------------------------------------------- /test/integration/golden/version/golden-0/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 0 2 | Name: Print version when no mani config is found 3 | WantErr: false 4 | Cmd: 5 | mani --version 6 | 7 | --- 8 | Version: dev 9 | Commit: none 10 | Date: n/a 11 | -------------------------------------------------------------------------------- /test/integration/golden/version/golden-1/mani.yaml: -------------------------------------------------------------------------------- 1 | projects: 2 | example: 3 | path: . 4 | 5 | pinto: 6 | path: frontend/pinto 7 | url: https://github.com/alajmo/pinto 8 | tags: [frontend] 9 | 10 | dashgrid: 11 | path: frontend/dashgrid/../dashgrid 12 | url: https://github.com/alajmo/dashgrid 13 | tags: [frontend, misc] 14 | 15 | template-generator: 16 | url: https://github.com/alajmo/template-generator 17 | tags: [cli] 18 | env: 19 | branch: dev 20 | 21 | env: 22 | VERSION: v.1.2.3 23 | TEST: $(echo "Hello World") 24 | NO_COLOR: true 25 | 26 | specs: 27 | table: 28 | output: table 29 | parallel: false 30 | ignore_errors: false 31 | 32 | tasks: 33 | fetch: 34 | desc: Fetch git 35 | cmd: git fetch 36 | 37 | status: 38 | cmd: git status 39 | 40 | checkout: 41 | env: 42 | branch: dev 43 | cmd: git checkout $branch 44 | 45 | create-branch: 46 | cmd: git checkout -b $branch 47 | 48 | multi: 49 | cmd: | # Multi line command 50 | echo "1st line " 51 | echo "2nd line" 52 | 53 | default-tags: 54 | target: 55 | tags: [frontend] 56 | cmd: pwd 57 | 58 | default-projects: 59 | target: 60 | projects: [dashgrid] 61 | cmd: pwd 62 | 63 | default-output: 64 | spec: 65 | output: table 66 | cmd: pwd 67 | 68 | pwd: pwd 69 | 70 | submarine: 71 | desc: Submarine test 72 | cmd: echo 0 73 | spec: table 74 | commands: 75 | - name: command-1 76 | cmd: echo 1 77 | - name: command-2 78 | cmd: echo 2 79 | - name: command-3 80 | cmd: echo 3 81 | - task: pwd 82 | -------------------------------------------------------------------------------- /test/integration/golden/version/golden-1/stdout.golden: -------------------------------------------------------------------------------- 1 | Index: 1 2 | Name: Print version when mani config is found 3 | WantErr: false 4 | Cmd: 5 | mani --version 6 | 7 | --- 8 | Version: dev 9 | Commit: none 10 | Date: n/a 11 | -------------------------------------------------------------------------------- /test/integration/init_test.go: -------------------------------------------------------------------------------- 1 | package integration 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestInit(t *testing.T) { 9 | var cases = []TemplateTest{ 10 | { 11 | TestName: "Initialize mani in empty directory", 12 | InputFiles: []string{}, 13 | TestCmd: "mani init --color=false", 14 | WantErr: false, 15 | }, 16 | 17 | { 18 | TestName: "Initialize mani with auto-discovery", 19 | InputFiles: []string{}, 20 | TestCmd: ` 21 | (mkdir -p dashgrid && touch dashgrid/empty); 22 | (mkdir -p tap-report && touch tap-report/empty && cd tap-report && git init -b main && git remote add origin https://github.com/alajmo/tap-report); 23 | (mkdir -p nested/template-generator && touch nested/template-generator/empty && cd nested/template-generator && git init -b main && git remote add origin https://github.com/alajmo/template-generator); 24 | (mkdir nameless && touch nameless/empty); 25 | (git init -b main && git remote add origin https://github.com/alajmo/pinto) 26 | mani init --color=false 27 | `, 28 | WantErr: false, 29 | }, 30 | 31 | { 32 | TestName: "Throw error when initialize in existing mani directory", 33 | InputFiles: []string{"mani-advanced/mani.yaml"}, 34 | TestCmd: "mani init --color=false", 35 | WantErr: true, 36 | }, 37 | } 38 | 39 | for i, tt := range cases { 40 | cases[i].Golden = fmt.Sprintf("init/golden-%d", i) 41 | cases[i].Index = i 42 | t.Run(tt.TestName, func(t *testing.T) { 43 | Run(t, cases[i]) 44 | }) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /test/integration/sync_test.go: -------------------------------------------------------------------------------- 1 | package integration 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestSync(t *testing.T) { 9 | var cases = []TemplateTest{ 10 | { 11 | TestName: "Throw error when trying to sync a non-existing mani repository", 12 | InputFiles: []string{}, 13 | TestCmd: ` 14 | mani sync 15 | `, 16 | WantErr: true, 17 | }, 18 | 19 | { 20 | TestName: "Should sync", 21 | InputFiles: []string{"mani-advanced/mani.yaml", "mani-advanced/.gitignore"}, 22 | TestCmd: ` 23 | mani sync 24 | `, 25 | WantErr: false, 26 | }, 27 | } 28 | 29 | for i, tt := range cases { 30 | cases[i].Golden = fmt.Sprintf("sync/golden-%d", i) 31 | cases[i].Index = i 32 | t.Run(tt.TestName, func(t *testing.T) { 33 | Run(t, cases[i]) 34 | }) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/integration/version_test.go: -------------------------------------------------------------------------------- 1 | package integration 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestVersion(t *testing.T) { 9 | var cases = []TemplateTest{ 10 | { 11 | TestName: "Print version when no mani config is found", 12 | InputFiles: []string{}, 13 | TestCmd: "mani --version", 14 | Ignore: true, 15 | WantErr: false, 16 | }, 17 | 18 | { 19 | TestName: "Print version when mani config is found", 20 | InputFiles: []string{"mani-advanced/mani.yaml"}, 21 | TestCmd: "mani --version", 22 | Ignore: true, 23 | WantErr: false, 24 | }, 25 | } 26 | 27 | for i, tt := range cases { 28 | cases[i].Golden = fmt.Sprintf("version/golden-%d", i) 29 | cases[i].Index = i 30 | t.Run(tt.TestName, func(t *testing.T) { 31 | Run(t, cases[i]) 32 | }) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/playground/.gitignore: -------------------------------------------------------------------------------- 1 | # mani # 2 | template-generator 3 | kaka 4 | frontend/tap-report 5 | frontend/dashgrid 6 | # mani # 7 | -------------------------------------------------------------------------------- /test/playground/imports/projects.yaml: -------------------------------------------------------------------------------- 1 | import: 2 | - ./tasks.yaml 3 | 4 | projects: 5 | template-generator: 6 | path: ../template-generator 7 | url: git@github.com:alajmo/template-generator 8 | tags: [cli,bash] 9 | 10 | -------------------------------------------------------------------------------- /test/playground/imports/specs.yaml: -------------------------------------------------------------------------------- 1 | specs: 2 | default: 3 | output: table 4 | parallel: false 5 | ignore_errors: false 6 | ignore_non_existing: false 7 | omit_empty_rows: false 8 | 9 | advanced: 10 | output: table 11 | parallel: false 12 | ignore_errors: true 13 | omit_empty_rows: false 14 | 15 | table: 16 | output: table 17 | parallel: false 18 | ignore_errors: true 19 | omit_empty_rows: false 20 | omit_empty_columns: false 21 | -------------------------------------------------------------------------------- /test/playground/imports/targets.yaml: -------------------------------------------------------------------------------- 1 | targets: 2 | default: 3 | all: false 4 | cwd: true 5 | 6 | tap-report: 7 | projects: [tap-report] 8 | 9 | all: 10 | all: true 11 | 12 | root: 13 | projects: [playground] 14 | cwd: true 15 | 16 | -------------------------------------------------------------------------------- /test/playground/imports/tasks.yaml: -------------------------------------------------------------------------------- 1 | tasks: 2 | hello: 3 | desc: hello world 4 | cmd: echo "Hello World" 5 | 6 | pwd: 7 | target: root 8 | cmd: pwd 9 | -------------------------------------------------------------------------------- /test/playground/imports/themes.yaml: -------------------------------------------------------------------------------- 1 | themes: 2 | default: 3 | tree: 4 | style: bold 5 | 6 | stream: 7 | prefix: true 8 | header: true 9 | header_char: '*' 10 | header_prefix: 'TASK' 11 | prefix_colors: ['blue', 'red'] 12 | 13 | table: 14 | style: light 15 | 16 | border: 17 | around: true 18 | columns: true 19 | header: true 20 | rows: false 21 | 22 | advanced: 23 | tree: 24 | style: light 25 | 26 | stream: 27 | prefix: true 28 | header: true 29 | header_char: '*' 30 | header_prefix: 'TASK' 31 | colors: ['blue', 'red'] 32 | 33 | table: 34 | style: ascii 35 | 36 | border: 37 | around: true 38 | columns: true 39 | header: true 40 | rows: true 41 | -------------------------------------------------------------------------------- /test/scripts/exec: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | APPNAME=mani 7 | PROJECT_DIR=$(dirname "$(cd "$(dirname "${0}")"; pwd -P)") 8 | 9 | function help() { 10 | cat >&2 << EOF 11 | This script is debugger for mani. 12 | 13 | Options: 14 | --test|-t {case} Run only cases which have specified pattern in the case names 15 | --count|-c {count} Run tests multiple times, the clean flag is necessary for this flag 16 | --help|-h Show this message 17 | 18 | Examples: 19 | 20 | ./test/run.sh 21 | 22 | EOF 23 | } 24 | 25 | function parse_options() { 26 | IMAGE=alpine 27 | SHELL=bash 28 | while [[ $# -gt 0 ]]; do 29 | case "${1}" in 30 | --image|-i) 31 | IMAGE="${2}" 32 | shift && shift 33 | ;; 34 | --shell|-s) 35 | SHELL="${2}" 36 | shift && shift 37 | ;; 38 | --help|-h) 39 | help && exit 0 40 | ;; 41 | *) 42 | printf "Unknown flag: ${1}\n\n" 43 | help 44 | exit 1 45 | ;; 46 | esac 47 | done 48 | } 49 | 50 | function exec_docker() { 51 | image="${APPNAME}/exec:${IMAGE}" 52 | 53 | shell= 54 | case $SHELL in 55 | zsh) 56 | shell="/bin/zsh" 57 | ;; 58 | fish) 59 | shell="/usr/bin/fish" 60 | ;; 61 | ps) 62 | shell="/bin/ps" 63 | ;; 64 | *) 65 | shell="/bin/bash" 66 | ;; 67 | esac 68 | 69 | docker build \ 70 | --file "$PROJECT_DIR/images/$IMAGE.exec.Dockerfile" \ 71 | --tag ${image} \ 72 | . 73 | 74 | docker run \ 75 | -it --rm \ 76 | "$image" \ 77 | "$shell" 78 | } 79 | 80 | function __main__() { 81 | parse_options $@ 82 | exec_docker 83 | } 84 | 85 | __main__ $@ 86 | -------------------------------------------------------------------------------- /test/scripts/git: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Mock git, used for testing purposes. 3 | 4 | git() { 5 | if [[ $1 == "clone" ]]; then 6 | mkdir -p "$4/.git" 7 | touch "$4/empty" 8 | # elif [[ $1 == "init" ]]; then 9 | # mkdir -p "$3/.git" 10 | # touch "$3/empty" 11 | else 12 | /usr/bin/git "$@" 13 | fi 14 | } 15 | 16 | git $@ 17 | --------------------------------------------------------------------------------