summaryrefslogtreecommitdiff
path: root/src/content/tils/2020/11/12
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/tils/2020/11/12')
-rw-r--r--src/content/tils/2020/11/12/diy-nix-bash-ci.adoc2
-rw-r--r--src/content/tils/2020/11/12/git-bisect-automation.adoc5
-rw-r--r--src/content/tils/2020/11/12/useful-bashvars.adoc6
3 files changed, 7 insertions, 6 deletions
diff --git a/src/content/tils/2020/11/12/diy-nix-bash-ci.adoc b/src/content/tils/2020/11/12/diy-nix-bash-ci.adoc
index 219b694..97ace30 100644
--- a/src/content/tils/2020/11/12/diy-nix-bash-ci.adoc
+++ b/src/content/tils/2020/11/12/diy-nix-bash-ci.adoc
@@ -12,7 +12,7 @@ to the server.
In most of my project I like to keep a `test` attribute which runs the test with
`nix-build -A test`. This way, a post-receive hook could look like:
-[source,shell]
+[source,sh]
----
#!/usr/bin/env bash
set -Eeuo pipefail
diff --git a/src/content/tils/2020/11/12/git-bisect-automation.adoc b/src/content/tils/2020/11/12/git-bisect-automation.adoc
index d7ea2ca..dff8737 100644
--- a/src/content/tils/2020/11/12/git-bisect-automation.adoc
+++ b/src/content/tils/2020/11/12/git-bisect-automation.adoc
@@ -10,11 +10,12 @@ I've already been in the situation when a bug was introduced and I didn't know
how it even was occurring, and running Git bisect over hundreds of commits to
pinpoint the failing commit was very empowering:
-....
+[source,sh]
+----
$ GOOD_COMMIT_SHA=e1fd0a817d192c5a5df72dd7422e36558fa78e46
$ git bisect start HEAD $GOOD_COMMIT_SHA
$ git bisect run sn -c './build.sh && ./run-failing-case.sh'
-....
+----
Git will than do a binary search between the commits, and run the commands you
provide it with to find the failing commit.
diff --git a/src/content/tils/2020/11/12/useful-bashvars.adoc b/src/content/tils/2020/11/12/useful-bashvars.adoc
index 84b93c3..fb148fb 100644
--- a/src/content/tils/2020/11/12/useful-bashvars.adoc
+++ b/src/content/tils/2020/11/12/useful-bashvars.adoc
@@ -13,7 +13,7 @@ on the terminal.
The {bash-bang-bang}[`!!` variable] refers to the previous command, and I find
useful when following chains for symlinks:
-[source,shell]
+[source,sh]
----
$ which git
/run/current-system/sw/bin/git
@@ -25,7 +25,7 @@ readlink $(which git)
It is also useful when you forget to prefix `sudo` to a command that requires
it:
-[source,shell]
+[source,sh]
----
$ requires-sudo.sh
requires-sudo.sh: Permission denied
@@ -43,7 +43,7 @@ The {bash-dollar-underscore}[`$_` variable] will give you the most recent
parameter you provided to a previous argument, which can save you typing
sometimes:
-[source,shell]
+[source,sh]
----
# instead of...
$ mkdir -p a/b/c/d/