diff --git a/CHANGELOG-1.0.md b/CHANGELOG-1.0.md new file mode 100644 index 0000000..56305bd --- /dev/null +++ b/CHANGELOG-1.0.md @@ -0,0 +1,9 @@ +# Changes in application-development-directory setup 1.0 +All notable changes of the application-development-directory 1.0 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. + +## 1.0 - July 12, 2017 +- Added functionality to change the installation directory for the directory structure. +- Added functionality to create the `Web_development`, `Desktop_application_development`, `Mobile_application_development`, `Other_application_development` folders inside the installation directory. +- Added functionality to create the `Exercise`, `Scrapboard`, `Other_stuff`, `Archive` folders inside the base folders. +- Added functionality to create specific project folders inside the base folder. +- Added functionality to create specific folders inside the `Archive` folder. diff --git a/EXAMPLE.txt b/EXAMPLE.txt new file mode 100644 index 0000000..9071fb7 --- /dev/null +++ b/EXAMPLE.txt @@ -0,0 +1,65 @@ +Install location: +│ +├───Desktop_application_development +│ ├───Archive +│ │ ├───Exercise +│ │ ├───Other_stuff +│ │ ├───Projects +│ │ └───Scrapboard +│ │ ├───Archive +│ │ ├───Exercise +│ │ ├───Other_stuff +│ │ └───Projects +│ ├───Exercise +│ ├───Other_stuff +│ ├───Projects +│ └───Scrapboard +│ ├───Archive +│ ├───Exercise +│ ├───Other_stuff +│ └───Projects +│ +├───Mobile_application_development +│ ├───Android_projects +│ ├───Archive +│ │ ├───Android_projects +│ │ ├───Exercise +│ │ ├───IOS_projects +│ │ ├───Other_stuff +│ │ └───Scrapboard +│ ├───Exercise +│ ├───IOS_projects +│ ├───Other_stuff +│ └───Scrapboard +│ +├───Other_application_development +│ ├───Archive +│ │ ├───Exercise +│ │ ├───Other_stuff +│ │ ├───Projects +│ │ └───Scrapboard +│ │ ├───Archive +│ │ ├───Exercise +│ │ ├───Other_stuff +│ │ └───Projects +│ ├───Exercise +│ ├───Other_stuff +│ ├───Projects +│ └───Scrapboard +│ ├───Archive +│ ├───Exercise +│ ├───Other_stuff +│ └───Projects +│ +└───Web_development + ├───Archive + │ ├───Back_end_projects + │ ├───Exercise + │ ├───Front_end_projects + │ ├───Other_stuff + │ └───Scrapboard + ├───Back_end_projects + ├───Exercise + ├───Front_end_projects + ├───Other_stuff + └───Scrapboard \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md index 3388a0a..0ed0505 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,26 +1,8 @@ -# The Unlicensed +# MIT License +Copyright (c) 2017 Bas van Driel -This is free and unencumbered software released into the public domain. +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR -OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - -For more information, please refer to \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 0eb6785..58a3313 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,12 @@ -# software-development-directory-setup +# application-development-directory-setup +This repository contains a script to create my personal directory setup +for web development, desktop application development, mobile application development and +other application development. -This repository contains scripts to setup my personal directory setup for application development. +These contain specific project folders, an exercise folder, a scrapboard folder and a +folder for unorganized files. -This contains web development, desktop application development and other software projects. +An example of the directory structure can be found in the [EXAMPLE.txt](EXAMPLE.txt) file. I created this project because I want to learn more about shell scripting. @@ -10,19 +14,24 @@ I created this project because I want to learn more about shell scripting. * The `git` tool ## Installation -Clone the repository to any directory on your computer. +Clone the repository to any directory on your computer and navigate to the bin folder. ```shell # Clones the repository -git clone https://github.com/basvandriel/software-development-directory-setup.git +git clone https://github.com/basvandriel/application-development-directory-setup.git + +# Navigate to the bin folder +cd bin/ ``` +From there open the `create-folders.cmd` file with administrator rights and follow the instructions. + ## License -This project is licensed under The Unlicensed - see the [LICENSE.md](LICENSE.md) file for details. +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. ## Links -* [Source code](https://github.com/basvandriel/software-development-directory-setup) -* [Issue tracker](https://github.com/basvandriel/software-development-directory-setup/issues) \ No newline at end of file +* [Source code](https://github.com/basvandriel/application-development-directory-setup) +* [Issue tracker](https://github.com/basvandriel/application-development-directory-setup/issues) diff --git a/bin/create-folders.cmd b/bin/create-folders.cmd new file mode 100644 index 0000000..0922936 --- /dev/null +++ b/bin/create-folders.cmd @@ -0,0 +1,131 @@ +@echo off +setlocal + +:: Set the folder names we want to create +SET FOLDER_NAMES=Web_development Desktop_application_development Mobile_application_development Other_application_development +SET INTERNAL_FOLDER_NAMES=Scrapboard Exercise Other_stuff Archive + +:: Set the specific web development folders we want to create +SET WEB_DEVELOPMENT_FOLDERS=Front_end_projects Back_end_projects +SET WEB_DEVELOPMENT_ARCHIVE_FOLDERS=Front_end_projects Back_end_projects Scrapboard Exercise Other_stuff + +:: Set the specific mobile development folders we want to create +SET MOBILE_APPLICATION_DEVELOPMENT_FOLDERS=Android_projects IOS_projects +SET MOBILE_APPLICATION_DEVELOPMENT_ARCHIVE_FOLDERS=Android_projects IOS_projects Scrapboard Exercise Other_stuff + +:: Set the specific desktop application development folders we want to create +SET DESKTOP_APPLICATION_DEVELOPMENT_FOLDERS=Projects +SET DESKTOP_APPLICATION_DEVELOPMENT_ARCHIVE_FOLDERS=Projects Scrapboard Exercise Other_stuff + +:: Set the specific other application development folders we want to create +SET OTHER_APPLICATION_DEVELOPMENT_FOLDERS=Projects +SET OTHER_APPLICATION_DEVELOPMENT_ARCHIVE_FOLDERS=Projects Scrapboard Exercise Other_stuff + +:: Welcome the user +echo Welcome to the application development directory setup +echo - Created by Bas van Driel +echo. +echo Before you submit the install directory, please empty the +echo folder as much as possible by moving everything out and +echo re-organise it later on. +echo. +echo This is for avoiding having confusing existing folders inside the install directory. +echo. +:: Set the default install directory +SET FOLDERS_INSTALL_LOCATION=%UserProfile% +echo The install directory is standard set to the user profile, +:: +:: Prompt the user for changing the folders install location +:PROMPT +echo (%FOLDERS_INSTALL_LOCATION%) do you want to change that? (Y/N) +SET /P TO_CHANGE_INSTALL_DIR= +echo. +IF /I "%TO_CHANGE_INSTALL_DIR%" NEQ "Y" GOTO END +:: Prompt for the new install location +SET /P FOLDERS_INSTALL_LOCATION="Install directory: " +:END +echo. +:: Start creating the base folders +echo Starting to create the base folders +echo ... +CALL :create-base-folders +echo. +CALL :create-internal-folders +:: End the application +pause +exit /b + +:: Create base folders +:create-base-folders +FOR %%a IN (%FOLDER_NAMES%) DO ( +:: The folder is found, no need to create it +IF EXIST %FOLDERS_INSTALL_LOCATION%\%%a ( +echo The folder "%%a" already exists. +) ELSE ( +echo The "%%a" folder does not exist in "%FOLDERS_INSTALL_LOCATION%", creating it. +md %FOLDERS_INSTALL_LOCATION%\%%a +) +) +exit /b + +:: Create internal folders +:create-internal-folders +FOR %%a IN (%FOLDER_NAMES%) DO ( +echo Starting to create internal for folders for "%%a". +echo ... +:: Create the base internal folders +FOR %%b IN (%INTERNAL_FOLDER_NAMES%) DO ( +IF EXIST %FOLDERS_INSTALL_LOCATION%\%%a\%%b ( +echo The folder "%%b" already exists in "%FOLDERS_INSTALL_LOCATION%\%%a". +) ELSE ( +echo The folder "%%b" does not exist in "%FOLDERS_INSTALL_LOCATION%\%%a, creating it". +md %FOLDERS_INSTALL_LOCATION%\%%a\%%b +) +) +echo. +:: Create specific folders +CALL :create-specific-internal-folders-by-base-folder-name %%a +echo. +) +exit /b + +:: Create specific internal folders by folder name +:create-specific-internal-folders-by-base-folder-name +:: Create specific web development folders +IF "%1"=="Web_development" ( +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1" "%WEB_DEVELOPMENT_FOLDERS%" +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1\Archive" "%WEB_DEVELOPMENT_ARCHIVE_FOLDERS%" +exit /b +) +:: Create specific mobile application development folders +IF "%1"=="Mobile_application_development" ( +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1" "%MOBILE_APPLICATION_DEVELOPMENT_FOLDERS%" +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1\Archive" "%MOBILE_APPLICATION_DEVELOPMENT_FOLDERS%" +exit /b +) +:: Create specific desktop application development folders +IF "%1"=="Desktop_application_development" ( +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1" "%DESKTOP_APPLICATION_DEVELOPMENT_FOLDERS%" +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1\Archive" "%DESKTOP_APPLICATION_DEVELOPMENT_FOLDERS%" +exit /b +) +:: Create specific other application development folders +IF "%1"=="Other_application_development" ( +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1" "%OTHER_APPLICATION_DEVELOPMENT_FOLDERS%" +CALL :create-specific-internal-folders-by-location-and-variable-name "%FOLDERS_INSTALL_LOCATION%\%1\Archive" "%OTHER_APPLICATION_DEVELOPMENT_FOLDERS%" +exit /b +) +exit /b + +:create-specific-internal-folders-by-location-and-variable-name +:: Location is %~1 +FOR %%a IN (%~2) DO ( +:: %%a is each folder name +IF EXIST %~1\%%a ( +echo The folder "%%a" already exists in "%~1". +) ELSE ( +echo The folder "%%a" does not exist in "%~1, creating it. +md %~1\%%a +) +) +exit /b diff --git a/bin/create-folders.sh b/bin/create-folders.sh deleted file mode 100644 index cc1f786..0000000 --- a/bin/create-folders.sh +++ /dev/null @@ -1 +0,0 @@ -#!/bin/bash \ No newline at end of file