nickthecook / ops

The operations team for your project.
GNU General Public License v3.0
50 stars 1 forks source link

`ops` prints errors when using `sh` as shell #64

Closed oxaronick closed 2 years ago

oxaronick commented 3 years ago

ops doesn't explicitly set the shell, but assumes bash. When run with sh as the shell, we get these errors:

$ ops lint
sh: 1: [: ci: unexpected operator
Running 'ops be rubocop' in environment 'ci'...
sh: 1: [: ci: unexpected operator
Running 'bundle exec rubocop' in environment 'ci'...

It would be good to have ops compatible with sh, or state the shells with which it is compatible.

nickthecook commented 2 years ago

Appears not to be an issue any longer:

sh-3.2$ export environment=ci
sh-3.2$ ops test
Running 'environment=test bundle exec rspec --exclude-pattern 'spec/e2e/**/*_spec.rb'' in environment 'ci'...

Randomized with seed 57001
 270/270 |=============================================== 100 ===============================================>| Time: 00:00:01

Finished in 1.35 seconds (files took 0.4442 seconds to load)
270 examples, 0 failures

This was likely due to the use of [ with == as an operator, which was present at some point, but no longer seems to be in the code.