Boris Buliga

Welcome to my personal site, where I irregularly post technical notes, usually Emacs or Haskell-related. I am developer at Wix during the daytime, and developer at home before and after the daytime. When I am not writing code, I am either drinking wine or drinking tea (with these little cups). Cheese is my bread and tracking everything in Emacs is my cheese. So welcome!

(tagged 'mirror-elpa)

Asking for input in Bash

April 12, 2019

Yet another tale about bash script refactoring. This time the configuration script of mirror-elpa had undergone some changes and I like the result so much that I decided to share it.

Imagine that you want your users to give you some input, for example, repository owner and name. And you want the value so desperately, that if the user doesn’t provide one, you ask the user again. On the other hand, you also want to support default values. So for example, if the user doesn’t provide any value, but there is a default value, you could use that.

And you can’t use anything except for bash.

Read more →