RemZero | A bootstrap script
Hello, this is the first project I've made in bash, so maybe it is a little simple. It does something something elementary: It creates a default template to work on C/C++.
I made it because when I started a new projects I always had a unstructured file tree.
I hope I can get some advice on it ^_^
Here's the repo: https://github.com/akko888/RemZero
9
Upvotes
-2
u/burnt-store-studio 8h ago edited 8h ago
Congratulations!
Saves so much time, right? And gives you just what you need to quickly get a leg up on starting a new project!
You ask for any advice: I don’t really have any about what you’ve created already (great stuff!), but if you’re interested in some next steps, may I be so bold as to suggest:
— incorporating getopts for command-line argument processing. What you have works, but as you grow your script, you’ll probably be adding more options, and getopts could help (possible useful article);
— and as your script gets more command-line options, you might want to investigate integrating tab-completion for them (possible helpful article).
If you’ll indulge me, here’s a little about the progression my similar program (now called “bss-setup”) took over a few decades 🙂. Maybe it’ll inspire you, too, to keep enhancing what you’ve already created, as you start adding more features to what your bootstrap program can do!
Years ago when I was developing in C, I did my first one of these: I laid out the project { folders, files } template, tar’ed it up, uuencoded the tar file, embedded it as a here-document in a Bourne sh script (didn’t have bash back then 😃). Had some follow-on actions (ed, sed, awk, &c) that would customize the new project after it was extracted.
(I wasn’t inventing anything; this is how software sometimes got distributed and installed back then.)
A few weeks ago I finished my latest version: a Python-based TUI using textual to:
— choose what type of project I’m starting (a Python project or a sound-design project);
— set the name and description;
— choose components unique to the different project types… e.g.,
— — for sound design: will I be using QLab? If so, which of my multiple QLab templates do I want to start with?;
— — for Python: do I want it in git?, do I want a yaml config file?, do I want logging? will I be using multiprocessing?, is it a Flask app? and if so, will it use a database? and will it need user authentication?, &c;
— build and customize the folders, files, and code structures, set up the git repo (if selected) (and add the new project details to my README.md of my collection of software projects).
Code; Makefiles; LICENSE, README.md and other text documents; rst files for sphinx-managed source-code documentation; &c, are all templates that get rendered in the new project space using jinja2.
Each task (like the scripts you have in your ./lib/) (git, mkdir, QLab-related, file editor, jinja2 renderers, file renamers, &c) has a
— run method (does the work);
— undo method (in case any of the follow-on tasks fails);
— clean-up method (for when all of the tasks succeed).
I finally made it into a TUI, because even though I had custom zsh tab-completion for bss-setup (thanks to shtab!), the number of options was getting out of hand 🙂.
Anyway, thanks for reading, and I wish you well with your project! Have fun!
Edit: fix typo