From c95d7c5c4584efdeda86a1300bbd88fccec77d12 Mon Sep 17 00:00:00 2001 From: marc0tjevp Date: Mon, 17 Jul 2017 00:32:41 +0200 Subject: [PATCH 1/2] Added a bash script for creating folders --- README.md | 6 +- bin/create-folders.sh | 163 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 167 insertions(+), 2 deletions(-) create mode 100644 bin/create-folders.sh diff --git a/README.md b/README.md index 58a3313..ed24476 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,15 @@ git clone https://github.com/basvandriel/application-development-directory-setup cd bin/ ``` -From there open the `create-folders.cmd` file with administrator rights and follow the instructions. +On Windows open the `create-folders.cmd` file with administrator rights and follow the instructions. +On Linux run the command `sh create-folders.sh`. ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details. ## Authors -This project was initially created by [Bas van Driel](https://github.com/basvandriel "GitHub page") ([@bvandriel](https://twitter.com/bvandriel "Twitter page")), where [these people](https://github.com/basvandriel/WWW/graphs/contributors) contributed to it. +- [Bas van Driel](https://github.com/basvandriel "GitHub page") ([@bvandriel](https://twitter.com/bvandriel "Twitter page")) +- [Marco van Poortvliet](https://www.github.com/marc0tjevp "GitHub page") ## Links * [Source code](https://github.com/basvandriel/application-development-directory-setup) diff --git a/bin/create-folders.sh b/bin/create-folders.sh new file mode 100644 index 0000000..0a0e8d4 --- /dev/null +++ b/bin/create-folders.sh @@ -0,0 +1,163 @@ +#!/bin/bash + +# Array with all main folders +mainFolders=(Desktop_application_development Mobile_application_development Other_application_development Web_application_development) + +# Arrays with all subfolders +desktopFolders=(Archive Exercise Other_stuff Projects Scrapboard) +mobileFolders=(Archive Android_projects Exercise IOS_projects Other_stuff Scrapboard) +otherFolders=(Archive Exercise Other_stuf Projects Scrapboard) +webFolders=(Archive Back_end_projects Exercise Font_end_projects Other_stuff Scrapboard) + +# Arrays with all archive folders +desktopArchiveFolders=(Exercise Other_stuff Projects Scrapboard) +mobileArchiveFolders=(Android_projects Exercise IOS_projects Other_stuff Scrapboard) +otherArchiveFolders=(Exercise Other_stuf Projects Scrapboard) +webArchiveFolders=(Back_end_projects Exercise Font_end_projects Other_stuff Scrapboard) + +# Markup used in the script +RED='\033[0;31m' +GREEN='\033[0;32m' +ORANGE='\033[1;43m' +TEST='\033[1;10m' +NC='\033[0m' +bold=$(tput bold) +normal=$(tput sgr0) + +# Default install folder +installFolder="DevelopmentFolder" + +# Clear the screen +clear + +# Welcome the user +echo +echo -e "${TEST}Welcome to the application development directory setup${NC}" +echo "- Created by Marco van Poortvliet" +echo +echo "This script will create a Development Folder which contains subfolders for Desktop, Mobile, Web and Other development. These folders also contain subfolders." +echo +echo -e "${RED}Folders that already exist will be skipped.${NC}" +echo + +# Ask user to continue or not +read -p "Do you wish to continue (${bold}Y${normal}/n)?" CONT +if [ "$CONT" = "Y" ]; then + + echo + echo -e "The default install folder is ${bold}${ORANGE}~/$installFolder${NC}${normal}" + echo + + # Ask user to change the install folder + read -p "Do you wish to change it (${bold}Y${normal}/n)?" CONT + if [ "$CONT" = "Y" ]; then + echo + echo -n "Enter the folder name and press [ENTER]: " + read installFolder + echo + echo -e "The new installation folder is ${bold}${ORANGE}~/$installFolder${NC}${normal}" + fi + + ########################## + # Create Project Folders # + ########################## + + echo + echo "Creating Project folders..." + echo + + for mainFolder in ${mainFolders[@]} + do + echo -e "${GREEN}Creating${NC} $mainFolder" + mkdir -p ~/$installFolder/$mainFolder + done + + ########################## + # Create Sub Folders # + ########################## + + echo + echo "Creating subfolders..." + echo + + for desktopFolder in ${desktopFolders[@]} + do + echo -e "${GREEN}Creating${NC} Desktop_application_development/$desktopFolder" + mkdir -p ~/$installFolder/Desktop_application_development/$desktopFolder + done + + echo + + for mobileFolder in ${mobileFolders[@]} + do + echo -e "${GREEN}Creating${NC} Mobile_application_development/$mobileFolder" + mkdir -p ~/$installFolder/Mobile_application_development/$mobileFolder + done + + echo + + for otherFolder in ${otherFolders[@]} + do + echo -e "${GREEN}Creating${NC} Other_application_development/$otherFolder" + mkdir -p ~/$installFolder/Other_application_development/$otherFolder + done + + echo + + for webFolder in ${webFolders[@]} + do + echo -e "${GREEN}Creating${NC} Web_application_development/$webFolder" + mkdir -p ~/$installFolder/Web_application_development/$webFolder + done + + ########################## + # Create Archive Folders # + ########################## + + echo + echo "Creating Archive and Scrapboard folders..." + echo + + for desktopArchiveFolder in ${desktopArchiveFolders[@]} + do + echo -e "${GREEN}Creating${NC} Desktop_application_development/Archive/$desktopArchiveFolder" + mkdir -p ~/$installFolder/Desktop_application_development/Archive/$desktopArchiveFolder + echo -e "${GREEN}Creating${NC} Desktop_application_development/Scrapboard/$desktopArchiveFolder" + mkdir -p ~/$installFolder/Desktop_application_development/Scrapboard/$desktopArchiveFolder + done + + echo + + for mobileArchiveFolder in ${mobileArchiveFolders[@]} + do + echo -e "${GREEN}Creating${NC} Mobile_application_development/Archive/$mobileArchiveFolder" + mkdir -p ~/$installFolder/Mobile_application_development/Archive/$mobileArchiveFolder + echo -e "${GREEN}Creating${NC} Mobile_application_development/Scrapboard/$mobileArchiveFolder" + mkdir -p ~/$installFolder/Mobile_application_development/Scrapboard/$mobileArchiveFolder + done + + echo + + for otherArchiveFolder in ${otherArchiveFolders[@]} + do + echo -e "${GREEN}Creating${NC} Other_application_development/Archive/$otherArchiveFolder" + mkdir -p ~/$installFolder/Other_application_development/Archive/$otherArchiveFolder + echo -e "${GREEN}Creating${NC} Other_application_development/Scrapboard/$otherArchiveFolder" + mkdir -p ~/$installFolder/Other_application_development/Scrapboard/$otherArchiveFolder + done + + echo + + for webArchiveFolder in ${webArchiveFolders[@]} + do + echo -e "${GREEN}Creating${NC} Web_application_development/Archive/$webArchiveFolder" + mkdir -p ~/$installFolder/Web_application_development/Archive/$webArchiveFolder + echo -e "${GREEN}Creating${NC} Web_application_development/Scrapboard/$webArchiveFolder" + mkdir -p ~/$installFolder/Web_application_development/Scrapboard/$webArchiveFolder + done + + echo + +else + exit 0 +fi From 7c2971dba0d720446e4ebf2a1ef879101c08d549 Mon Sep 17 00:00:00 2001 From: Bas van Driel Date: Mon, 17 Jul 2017 13:54:17 +0200 Subject: [PATCH 2/2] Changed docs --- CHANGELOG-1.1.md | 5 +++++ README.md | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 CHANGELOG-1.1.md diff --git a/CHANGELOG-1.1.md b/CHANGELOG-1.1.md new file mode 100644 index 0000000..6aecfd2 --- /dev/null +++ b/CHANGELOG-1.1.md @@ -0,0 +1,5 @@ +# Changes in application-development-directory setup 1.1 +All notable changes of the application-development-directory 1.1 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## 1.1 - July 17, 2017 +- Added Linux compatibility for all previous features released in 1.0. \ No newline at end of file diff --git a/README.md b/README.md index ed24476..470c990 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,10 @@ git clone https://github.com/basvandriel/application-development-directory-setup cd bin/ ``` -On Windows open the `create-folders.cmd` file with administrator rights and follow the instructions. -On Linux run the command `sh create-folders.sh`. +On a Windows machine run the `create-folders.cmd` script with administrator rights and +follow the instructions. + +On a Linux machine run the command `sh create-folders.sh` inside the `bin` folder. ## License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.