Comments (2)
It seems like the goto solution has been to append || true
to commands so that it always returns an exit code of 0
.
#36
Personally I agree though -- this solution isn't good enough if you need to fork your runbook behaviour depending on certain steps.
Check if file is present
-->
exit 1
--> create the file
exit 0
--> use said file
This is the code I use for that:
capture "file detect #{filename} && echo 'SUCCESS' || echo 'FAILURE'", into: :existing_file
ruby_command do
next if @existing_file == 'SUCCESS'
command 'create file'
end
I don't think we can do better than a true
or false
. If you want to get fancier you might need to do more bash which undermines the point of having a ruby runbook handler.
from runbook.
Thanks for the suggestion. I'll leave this open to see if there is other feedback but the workaround makes sense.
from runbook.
Related Issues (20)
- cd exit status: 127 (SSHKit::Command::Failed) HOT 4
- How does "previous position detected" work? HOT 2
- Dealing with errors HOT 2
- Long running processes HOT 5
- tmux_command HOT 2
- tmux_command doesn't seem to respect server HOT 2
- command `curl` doesn't do what I expected HOT 1
- Ability to set `report_on_exception = false`? HOT 2
- Ruby 3 compatibility issue? :into keyword in `ask?` HOT 2
- Builds broken after version bump to 1.0
- Switch to Github Actions?
- Is Local Command Execution supported? HOT 1
- Add support for Ruby 3.1
- Crash when generating projects with `-`
- Jump to specific Position doesn't check input
- DidYouMean update
- Clarification: context of `path`
- Incompatibilities to tmux version 3.4 HOT 1
- Maintained repo or alternative HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from runbook.