python makedirs.py -f input.txt -o output.txt -indent 4
From a given txt file of directories and/or files structured by indentation generate a sh script that can create that directory tree. Be carefull with indentation.
Example:
input.txt
css/
styles.css
version/
index.html
javascript/
index.js
timer.js
modules/
work.js
stuff.js
src/
css/
style.css
js/
main.js
module/
src.js
README.md
test/
one/
a/ b/ c/
file_c.txt
file_b.txt
two/
a/
b/
c/
file_c.txt
file_b.txt
three/ a/
b/ c/
file_c.txt
file_b.txt
four/ a/ b/
c/ d/
e/
output.sh
mkdir -p {css,javascript,src,test}
touch {index.html,README.md}
touch css/styles.css
mkdir -p css/version/
touch javascript/{index.js,timer.js,stuff.js}
mkdir -p javascript/modules/
touch javascript/modules/work.js
mkdir -p src/{css,js}
touch src/css/style.css
touch src/js/main.js
mkdir -p src/js/module/
touch src/js/module/src.js
mkdir -p test/{one,two,three,four}
touch test/one/a/b/file_b.txt
mkdir -p test/one/a/b/c/
touch test/one/a/b/c/file_c.txt
touch test/two/a/b/file_b.txt
mkdir -p test/two/a/b/c/
touch test/two/a/b/c/file_c.txt
touch test/three/a/b/file_b.txt
mkdir -p test/three/a/b/c/
touch test/three/a/b/c/file_c.txt
mkdir -p test/four/a/b/c/d/e/