We all like to use the simplest tool that solves our problem, but it’s not always optimal in the long run, nor when you want to run it on multiple machines.

Say, for example, that you have a shell script that builds your project. You want to ensure you can call the script from different folders, so the first thing you want to do is to find the root of the project and make that the working directory:

SCRIPT_PATH="$(readlink -f "$0")"
PROJECT_ROOT="$(dirname "${SCRIPT_PATH}")"
cd "${PROJECT_ROOT}"

After that, because you have a bug with some build artefacts being stale and cached, you want to remove all the artefacts you’ve built before. That ensures we don’t have any old crap left from an earlier build:

find build gen -type f \( -n...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help