7

Hey, fellow ranters.
I got bored and have written a script for managing dotfiles in Linux.
If anyone wants to try
https://gitlab.com/rainee/configra

Comments
  • 1
    Good job.
    Although it's not 'entirely bash', non-posix, bashisms, security issues

    but it's nice to see people scripting :)
  • 0
    @netikras
    Yeah, I'm fairly new to writing more complex bash-scripts, but I needed something, that can run without tons of additional dependency's and wasn't content with the other exiting solutions.
  • 3
    @metamourge since you are, as you say, fairly new, here are a few suggestions. Feel free to ignore them if you want :)

    - more often than not 'tree' is not preinstalled on systems. Either manage it as a dependency (makefile, prepare() function or whereever), or warn users in README that 'tree' is required. I hate scripters for not warning me that some speciffic tool is required and I only find it out when the script needs it....

    - hardcode IFS and PATH. Either that or use full paths to binaries.

    - [ x == y ] --> no need for double equality. Single is enough for comparision.

    - BASH is slow. Firing new subshels make your scripts slower. Use $() and pipes as little as possible (also.. there's already a bash's built-in ${PWD} variable).

    - are you sure you do not need 'cp -p' instead of just plain 'cp' ?

    - user's homedir is not always at /home/<username>

    - you're fucked if user enters file paths/names having spaces/tabs. Quote stuff carefully
Add Comment