Hackernoon logoHow to Generate Bash Scripts with NodeJS by@alexadam

How to Generate Bash Scripts with NodeJS

This is a simple NodeJS app that takes a source folder as input and generates a Bash script. The Bash script has all the files' content and the folders' structure in the source folder, and it can recreate them when executed. Source code available here: https://://github.com/alexadam/fileders-to-script/filing-a-script. First step: iterate through all files in source folder and listFiles. If file is a directory, add an mkdir -p command. Test if file is binary or text, based on extension.
Alex Adam Hacker Noon profile picture

Alex Adam

Creative Coder


Join Hacker Noon

Create your free account to unlock your custom reading experience.