Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Test
on:
pull_request:
push: { branches: master }

jobs:
test:
name: Ruby ${{ matrix.ruby }}

runs-on: ubuntu-latest

strategy:
matrix: { ruby: ['2.4', '2.5', '2.6', '2.7'] }

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Cache gem dependencies
uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-bundle

- name: Setup Ruby
uses: actions/setup-ruby@v1
with: { ruby-version: '${{ matrix.ruby }}' }

- name: Bundle install
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3

- name: Run tests
run: bundle exec rspec

- name: Run shellcheck tests
run: bundle exec run shellcheck
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Bashly - Bash CLI Framework and Generator
Create beautiful bash scripts from simple YAML configuration

[![Gem Version](https://badge.fury.io/rb/bashly.svg)](https://badge.fury.io/rb/bashly)
[![Build Status](https://travis-ci.com/DannyBen/bashly.svg?branch=master)](https://travis-ci.com/DannyBen/bashly)
[![Build Status](https://github.com/DannyBen/bashly/workflows/Test/badge.svg)](https://github.com/DannyBen/bashly/actions?query=workflow%3ATest)
[![Maintainability](https://api.codeclimate.com/v1/badges/8cf89047e50ca601e431/maintainability)](https://codeclimate.com/github/DannyBen/bashly/maintainability)

---
Expand Down
4 changes: 3 additions & 1 deletion lib/bashly/polyfills/hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ def self.empty?(path_name)
exist?(path_name) && (entries(path_name) - ['.', '..']).empty?
end
end
end
end

# :nocov:
3 changes: 1 addition & 2 deletions spec/approvals/cli/add/colors
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
created spec/tmp/src/lib/colors.sh

created spec/tmp/src/lib/colors.sh
3 changes: 1 addition & 2 deletions spec/approvals/cli/add/config
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
created spec/tmp/src/lib/config.sh

created spec/tmp/src/lib/config.sh
3 changes: 1 addition & 2 deletions spec/approvals/cli/add/lib
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
created spec/tmp/src/lib/sample_function.sh

created spec/tmp/src/lib/sample_function.sh
3 changes: 1 addition & 2 deletions spec/approvals/cli/add/strings
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
created spec/tmp/src/bashly-strings.yml

created spec/tmp/src/bashly-strings.yml
2 changes: 1 addition & 1 deletion spec/approvals/cli/add/strings-exist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
skipped spec/tmp/src/bashly-strings.yml (exists)
skipped spec/tmp/src/bashly-strings.yml (exists)
3 changes: 1 addition & 2 deletions spec/approvals/cli/add/yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
created spec/tmp/src/lib/yaml.sh

created spec/tmp/src/lib/yaml.sh
8 changes: 4 additions & 4 deletions spec/approvals/cli/commands
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Bashly - Bash CLI Generator

Commands:
init Initialize a new workspace
preview Generate the bash script to STDOUT
generate Generate the bash script and required files
add Add extra features and customization to your script
init Initialize a new workspace
preview Generate the bash script to STDOUT
generate Generate the bash script and required files
add Add extra features and customization to your script
5 changes: 2 additions & 3 deletions spec/approvals/cli/error
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
Errno::ENOENT
Errno::ENOENT
No such file or directory @ rb_sysopen - src/bashly.yml
creating user files in src

creating user files in src
10 changes: 5 additions & 5 deletions spec/approvals/cli/generate/minimal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
creating user files in spec/tmp/src
created spec/tmp/src/initialize.sh
created spec/tmp/src/root_command.sh
created spec/tmp/download
run spec/tmp/download --help to test your bash script
creating user files in spec/tmp/src
created spec/tmp/src/initialize.sh
created spec/tmp/src/root_command.sh
created spec/tmp/download
run spec/tmp/download --help to test your bash script
12 changes: 6 additions & 6 deletions spec/approvals/cli/generate/no-args
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
creating user files in spec/tmp/src
created spec/tmp/src/initialize.sh
created spec/tmp/src/download_command.sh
created spec/tmp/src/upload_command.sh
created spec/tmp/cli
run spec/tmp/cli --help to test your bash script
creating user files in spec/tmp/src
created spec/tmp/src/initialize.sh
created spec/tmp/src/download_command.sh
created spec/tmp/src/upload_command.sh
created spec/tmp/cli
run spec/tmp/cli --help to test your bash script
12 changes: 6 additions & 6 deletions spec/approvals/cli/generate/no-args-skip
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
creating user files in spec/tmp/src
skipped spec/tmp/src/initialize.sh (exists)
skipped spec/tmp/src/download_command.sh (exists)
skipped spec/tmp/src/upload_command.sh (exists)
created spec/tmp/cli
run spec/tmp/cli --help to test your bash script
creating user files in spec/tmp/src
skipped spec/tmp/src/initialize.sh (exists)
skipped spec/tmp/src/download_command.sh (exists)
skipped spec/tmp/src/upload_command.sh (exists)
created spec/tmp/cli
run spec/tmp/cli --help to test your bash script
4 changes: 2 additions & 2 deletions spec/approvals/cli/init/minimal
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
created spec/tmp/src/bashly.yml
run bashly generate to create the bash script
created spec/tmp/src/bashly.yml
run bashly generate to create the bash script
4 changes: 2 additions & 2 deletions spec/approvals/cli/init/no-args
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
created spec/tmp/src/bashly.yml
run bashly generate to create the bash script
created spec/tmp/src/bashly.yml
run bashly generate to create the bash script
18 changes: 9 additions & 9 deletions spec/approvals/examples/colors
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
+ bashly generate
creating user files in src
skipped src/initialize.sh (exists)
skipped src/root_command.sh (exists)
created ./colorly
run ./colorly --help to test your bash script
creating user files in src
skipped src/initialize.sh (exists)
skipped src/root_command.sh (exists)
created ./colorly
run ./colorly --help to test your bash script
+ ./colorly
Message Recevied:
Message Recevied:

=> hello colors
==> hello colors
===> hello colors
=> hello colors
==> hello colors
===> hello colors

12 changes: 6 additions & 6 deletions spec/approvals/examples/command-default
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/upload_command.sh
created src/download_command.sh
created ./ftp
run ./ftp --help to test your bash script
creating user files in src
created src/initialize.sh
created src/upload_command.sh
created src/download_command.sh
created ./ftp
run ./ftp --help to test your bash script
+ ./ftp
ftp - Sample application that uses the default command option

Expand Down
16 changes: 8 additions & 8 deletions spec/approvals/examples/command-groups
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/download_command.sh
created src/upload_command.sh
created src/login_command.sh
created src/logout_command.sh
created ./ftp
run ./ftp --help to test your bash script
creating user files in src
created src/initialize.sh
created src/download_command.sh
created src/upload_command.sh
created src/login_command.sh
created src/logout_command.sh
created ./ftp
run ./ftp --help to test your bash script
+ ./ftp
ftp - Sample application with command grouping

Expand Down
12 changes: 6 additions & 6 deletions spec/approvals/examples/commands
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/download_command.sh
created src/upload_command.sh
created ./cli
run ./cli --help to test your bash script
creating user files in src
created src/initialize.sh
created src/download_command.sh
created src/upload_command.sh
created ./cli
run ./cli --help to test your bash script
+ ./cli
cli - Sample application

Expand Down
16 changes: 8 additions & 8 deletions spec/approvals/examples/commands-nested
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/dir_list_command.sh
created src/dir_remove_command.sh
created src/file_show_command.sh
created src/file_edit_command.sh
created ./cli
run ./cli --help to test your bash script
creating user files in src
created src/initialize.sh
created src/dir_list_command.sh
created src/dir_remove_command.sh
created src/file_show_command.sh
created src/file_edit_command.sh
created ./cli
run ./cli --help to test your bash script
+ ./cli
cli - Sample application with nested commands

Expand Down
14 changes: 7 additions & 7 deletions spec/approvals/examples/config-ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
+ bashly generate
creating user files in src
skipped src/initialize.sh (exists)
skipped src/set_command.sh (exists)
skipped src/get_command.sh (exists)
skipped src/list_command.sh (exists)
created ./configly
run ./configly --help to test your bash script
creating user files in src
skipped src/initialize.sh (exists)
skipped src/set_command.sh (exists)
skipped src/get_command.sh (exists)
skipped src/list_command.sh (exists)
created ./configly
run ./configly --help to test your bash script
+ ./configly -h
configly - Sample application that uses the config functions

Expand Down
10 changes: 5 additions & 5 deletions spec/approvals/examples/custom-includes
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
+ bashly generate
creating user files in src
skipped src/initialize.sh (exists)
skipped src/root_command.sh (exists)
created ./download
run ./download --help to test your bash script
creating user files in src
skipped src/initialize.sh (exists)
skipped src/root_command.sh (exists)
created ./download
run ./download --help to test your bash script
+ ./download
Before custom code
---
Expand Down
10 changes: 5 additions & 5 deletions spec/approvals/examples/custom-strings
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./download
run ./download --help to test your bash script
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./download
run ./download --help to test your bash script
+ ./download
Boom! a required argument is missing: SOURCE
usage: download SOURCE [options]
Expand Down
12 changes: 6 additions & 6 deletions spec/approvals/examples/dependencies
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
+ bashly generate
creating user files in src
skipped src/initialize.sh (exists)
skipped src/download_command.sh (exists)
skipped src/upload_command.sh (exists)
created ./cli
run ./cli --help to test your bash script
creating user files in src
skipped src/initialize.sh (exists)
skipped src/download_command.sh (exists)
skipped src/upload_command.sh (exists)
created ./cli
run ./cli --help to test your bash script
+ ./cli download
missing dependency: shmurl
+ ./cli upload
Expand Down
14 changes: 7 additions & 7 deletions spec/approvals/examples/docker-like
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/container_run_command.sh
created src/container_stop_command.sh
created src/image_ls_command.sh
created ./docker
run ./docker --help to test your bash script
creating user files in src
created src/initialize.sh
created src/container_run_command.sh
created src/container_stop_command.sh
created src/image_ls_command.sh
created ./docker
run ./docker --help to test your bash script
+ ./docker
docker - Docker example

Expand Down
10 changes: 5 additions & 5 deletions spec/approvals/examples/environment-variables
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
+ bashly generate
creating user files in src
skipped src/initialize.sh (exists)
skipped src/verify_command.sh (exists)
created ./cli
run ./cli --help to test your bash script
creating user files in src
skipped src/initialize.sh (exists)
skipped src/verify_command.sh (exists)
created ./cli
run ./cli --help to test your bash script
+ ./cli
cli - Sample application that requires environment variables

Expand Down
12 changes: 6 additions & 6 deletions spec/approvals/examples/git-like
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/status_command.sh
created src/commit_command.sh
created ./git
run ./git --help to test your bash script
creating user files in src
created src/initialize.sh
created src/status_command.sh
created src/commit_command.sh
created ./git
run ./git --help to test your bash script
+ ./git
git - Git example

Expand Down
10 changes: 5 additions & 5 deletions spec/approvals/examples/minimal
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./download
run ./download --help to test your bash script
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./download
run ./download --help to test your bash script
+ ./download
missing required argument: SOURCE
usage: download SOURCE [TARGET] [options]
Expand Down
10 changes: 5 additions & 5 deletions spec/approvals/examples/minus-v
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
+ bashly generate
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./cli
run ./cli --help to test your bash script
creating user files in src
created src/initialize.sh
created src/root_command.sh
created ./cli
run ./cli --help to test your bash script
+ ./cli
# this file is located in 'src/root_command.sh'
# you can edit it freely and regenerate (it will not be overwritten)
Expand Down
Loading