alan-if / alan-docs

Alan IF Documentation Project

Home Page:https://git.io/alan-docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adopt Shell Scripts from StdLib Repository

tajmone opened this issue · comments

In the AlanStdLib repository I'm developing a rather powerful set of Bash functions to handle the various toolchains efficiently — see the assets/sh/ folder on StdLib repo.

These scripts assets enforce a working environment that is initialized at each script execution, providing global functions and variables that simplify some common operation that are fairly complex — e.g. converting ALAN related files to UTF-8 for Asciidoctor inclusion, and sanitize them by formatting transcript logs to AsciiDoc, and removing region tag comments line in the ALAN sources that are deployed to end users (e.g. the tutorial files from the ALAN Beginner's Guide). The also provide some helper functions for common Bash operations, like translating relative paths to absolute paths, or converting Bash paths to Windows paths, which are both required when dealing with some third party dependencies that require path parameters (some apps don't work well under Bash for Windows, hence the need for paths fixes).

Switching all scripts to .sh will eliminate the current scripts redundancy (Bash and Batch) and provide a better cross-platform toolchain, especially where CI operations are involved.

Currently those scripts are still bound to the StdLib repository, but I'm gradually working on making them project-agnostic, and will possible move them to a dedicated repository so that they can be included as a Git module in any ALAN project that needs them, thus centralizing their maintenance and simplifying toolchains updates across the various ALAN repositories.

When the scripts will be ready, I'd like to integrate them in the Alan-Docs repository, and replace all the current scripts with the new Bash toolchain, which will provide a more efficient and consistent way of handling the various documents. It will take some time though, so in the meantime we'll have to keep using the current Shell/Batch scripts.