metaist / idempotent-bash Goto Github PK
View Code? Open in Web Editor NEWMake your bash scripts idempotent.
License: MIT License
Make your bash scripts idempotent.
License: MIT License
Currently, whenever there is an error, we dump the log and exit. When running in parallel, however, this tends to create an annoying cascade of log dumps.
Although we should add more features to handle parallelism, one thing that would be help would be to simply turn off the default behavior of dumping the log and exiting.
Looks like you need to set the environment variable APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE
to a non-empty value to avoid this warning.
When a package is already installed, there's no need to call ib-apt-update
.
It doesn't matter if the cache is out-of-date if there's nothing to install.
Most of the time grep
should be called: grep -qsPe $pattern
so that only an return code is produced and no errors for missing files are generated.
It currently treats multiple packages a single entity.
It should only use the first line so you can use a special comment for a block of config text to add.
These would be utility functions that quietly change directories. Technically, these aren't idempotent (although we could check to see if we are already in the correct directory and not move).
See also:
If /var/cache/apt/pkgcache.bin
doesn't exist, tests fail:
stat: cannot stat ‘/var/cache/apt/pkgcache.bin’: No such file or directory
../src/ib-apt.sh: line 34: 1459306405 - : syntax error: operand expected (error token is "- ")
To check if a link is correct, determine the real path for both the source and the target. Currently, we're only checking the target's real path.
It is hard to make references to the current user (e.g., ~/.bashrc
) if everything runs as sudo
(e.g., apt
).
Appending multiple lines requires an explicit pattern.
Add a third parameter that will toggle between copy and link.
Execute a SQL command conditional on some other SQL command.
It is a little confusing to call ib module-function
instead of ib-module-function
.
Instead of using ib
to parse args before calling the ib-module-function
, we could add a little overhead to each function call that would parse and rearrange args into an array.
Code is in ib-pip-install
.
Slightly more compatible with OSX.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.