2
1
mirror of https://github.com/kdabir/has.git synced 2024-09-18 17:01:29 +02:00
Commit Graph

14 Commits

Author SHA1 Message Date
Virgil
0e92f29a24 🎨 follow Bats coding style for tests
- [x] renamed working directory variable to `HAS_TMPDIR`
- [x] explicitly calling has binary
- [x] Only using `[[ ]]` for regex matches
2019-05-21 07:00:23 +10:00
Virgil
f5981b9145 Linting with shellcheck (#32)
* [SC2196] Use grep -Eegrep is non-standard and deprecated.

* [SC2086] Double quoting

Double quote to prevent globbing and word splitting.

* [SC2059] printf syntax

Don't use variables in the printf format string.
Use printf "..%s.." "$foo".

Update matching test to not assume whitespace is <space>

* [SC2002] Useless cat.

Consider 'cmd < file | ..' or 'cmd file | ..' instead.

* Update Unicode PASS/FAIL output

- [x] NEW variables for 'checkmark' and 'fancy x' and tput colours
  - [x] eg: `checkmark` = `\342\234\223`
  - [x] eg: `PASS=${txtbold}${txtgreen}${checkmark}${txtreset}`
  - [x] update `printf` statements to use `%b` for unicode variables.
- [x] Using readonly variables for
  - [x] $BINARY_NAME and $VERSION
  - [x] $PASS and $FAIL
- [x] refactor `.hasrc` file reading
  - [x] [SC2002] Useless cat
- [x] Add new BATS tests for Unicode output

* Repo scaffolding - shellscript filetype

- [x] Add shellscripts to `.editorconfig`
- [x] Add shellscripts to `.gitattributes`

* Refactored tests to use consistent unicode glyphs.
2019-04-23 12:08:38 +05:30
Virgil
36e11e238f Freshen Makefile and update README.md (#31)
Details:

* Freshen Makefile and update README.md

- [x] Add `sudo` to revelvant commands
- [x] Use named languages (bash) in fenced codeblocks
- [x] Use `console` in fenced codeblocks for command output

- [x] Use `install` with permission mode

The permissions on `has` were 777 from `git clone`.

- [x] Add option to use $PREFIX

What if I don't want to install to /usr/local/bin?

`make PREFIX=$HOME/.local install` now works.

- [x] Add `update` target for `git pull`
- [x] Include .PHONY targets

* Freshen Makefile and update README.md

- [x] Add `sudo` to revelvant commands
- [x] Use named languages (bash) in fenced codeblocks
- [x] Use `console` in fenced codeblocks for command output

- [x] Use `install` with permissions set

The permissions on `has` were 777 from `git clone`.

- [x] Add option to use $PREFIX

What if I don't want to install to /usr/local/bin?

`make PREFIX=$HOME/.local install` now works.

- [x] Add `update` target for `git pull`
- [x] Include .PHONY targets

- [x] Add tests for Makefile changes
- [x] Uses `bats` variables for directories

- ✓ make install creates a valid installation
- ✓ ..even if has is missing from directory
- ✓ make update runs git pull

* Update .hastest.bats

temp remove "git pull" check.

* Update travis to use bats-core 1.10

Do not be concerned about dirty working tree when running make update.

* Change version output to non-blinking.

* Update travis to use bats-core 1.10

Do not be concerned about dirty working tree when running make update.

* Working makefile

* Use `[[` and `@` for the $lines match.

* `make install` MacOS friendly again
2019-04-04 16:09:17 +05:30
Kunal Dabir
10c906e7f8 fix regression created with #15. self verion had stopped working. now added a test for it 2018-11-17 11:05:14 +05:30
Kunal Dabir
33cbc13738 #15 update documentation for .hasrc file 2018-11-16 16:50:36 +05:30
Kunal Dabir
44a71cf023 #15 test for excluding comments (lines starting with a #) 2018-11-16 16:23:34 +05:30
Kunal Dabir
1702c991ce implements #15
support for .hasrc file in current working directory, from where
has command is fired. these commands are merged with cli args.
2018-11-16 16:01:11 +05:30
Kunal Dabir
79f3eb8bba fixes #27 return status code only upto 126 2018-11-16 07:58:05 +05:30
Jason Phan
4d1035e241 added: colors (#26)
Support Colors #12 

* added: colors

No more echo with variables in them. Think of it like the Holocaust... Never. Again.

* update: removed color codes from tests
2018-11-15 10:39:17 +05:30
Kunal Dabir
e206cbfa21 udpate test names and tool names 2017-08-29 09:23:21 +05:30
Kunal Dabir
43caa970a1 add test for status code > 1 2017-08-29 09:18:13 +05:30
Kunal Dabir
3b6dbf78e4 return exit status based on number of failed commands, 0 means all passed 2017-08-29 09:14:08 +05:30
Kunal Dabir
1745c1d2b2 node was not there on travis, git must be :) 2017-08-28 22:10:04 +05:30
Kunal Dabir
c4695a0bdd add basic tests and travis config 2017-08-28 21:37:44 +05:30