diff --git a/BashScript-setupGodotProjectDirectoryStructure b/BashScript-setupGodotProjectDirectoryStructure index d624904..3759ae8 100755 --- a/BashScript-setupGodotProjectDirectoryStructure +++ b/BashScript-setupGodotProjectDirectoryStructure @@ -1,38 +1,48 @@ #!/bin/bash -echo -read -p "Are you sure you are in the root folder of the Godot project you want to create the structure for? (y/n): " userOk - -if [ $userOk != 'y' ] && [ $userOk != 'Y' ]; then - echo - echo "Please move to the appropriate directory and run this script again." - echo - exit 0 -fi - -#make addons directory -mkdir addons -echo "Addons directory created" - -# make assets directory and sub-directories -mkdir assets -cd assets -mkdir -p audio/sounds_effects audio/music art/sprites art/spritesheets art/textures art/tilesets -cd .. -echo "Assets directory and sub-directories created" - -# make scenes directory and sub-directories -mkdir scenes -cd scenes -mkdir characters components effects items levels weapons world_objects -cd characters -mkdir enemies bosses npcs -cd ../.. -echo "Scenes directory and sub-directories created" - -# make scripts directory and sub-directories -mkdir -p scripts/autoloads -echo "Scripts directory and sub-directories created" +validate_project_dir () { + if [ ! -f project.godot ]; then + echo + echo "Please move to the appropriate directory and run this script again." + echo + exit 1 + fi +} + +create_addons_dirs () { + mkdir -p addons + echo "Addons directory created" +} + +create_assets_dirs () { + # Audio + mkdir -p assets/audio/sounds_effects assets/audio/music + # Art + mkdir -p assets/art/sprites assets/art/spritesheets assets/art/textures assets/art/tilesets + echo "Assets directory and sub-directories created" +} + +create_scenes_dirs () { + # Charactor Scenes + mkdir -p scenes/characters/enemies scenes/characters/bosses scenes/characters/npcs + # Other Scenes + mkdir -p scenes/components scenes/effects scenes/items scenes/levels scenes/weapons scenes/world_objects + echo "Scenes directory and sub-directories created" +} + +create_scripts_dirs () { + mkdir -p scripts/autoloads + echo "Scripts directory and sub-directories created" +} + +## Execution Chain +echo # Padding from previous terminal executions +validate_project_dir + +# Create Directories +create_addons_dirs +create_assets_dirs +create_scenes_dirs +create_scripts_dirs echo "Done creating Godot project directory structure." - diff --git a/README.md b/README.md index a88f731..569c984 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,19 @@ ## Any software tools you make to add convenience to the development process -### BashScript-setupGodotProjectDirectoryStructure -Bash script (so should work on Linux and Mac, but now Windows) to setups a starting project directory structure. This is just a directory structure I made based on personal preferences, once we decide on a standard directory structure for the community we can update this to match that decision. Also gonna need a Windows user to make a version of the script that works in Windows. -

-Usage: After you make an empty Godot project, run this script in the project's root folder. +### Directory Tree Setup Scripts + +The following scripts can be used in an empty Godot project to create a basic directory structure. The scripts should be run from inside the base/root directory of the project. + +#### BashScript-setupGodotProjectDirectoryStructure + +Should work in any shell that can interpret Bash. For Linux, macOS; should work with Git for Windows' Bash shell as well. + +Current implementation does not prompt for user confirmation, and may be run headless or in an active terminal. + +#### BatchScript-setupGodotProjectDirectoryStructure + +*Initial Commit by [basile-laderchi](https://github.com/basile-laderchi).* + +Similar function as the Bash script, but intended for use in traditonal Windows NT environment. Execute with Windows' Command Prompt (`cmd.exe`). + +Current implementation asks for user confirmation.