Created
September 20, 2023 13:40
-
-
Save wagura-maurice/6822678d557386045294087e843f1f95 to your computer and use it in GitHub Desktop.
script to only create the folder structure and respective .vue and .ts files in the current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Determine file extension for Vue.js with TypeScript | |
FILE_EXTENSION=".vue" | |
# Set up the desired project directory structure for Vue | |
DIRECTORIES=( | |
"src/assets/images" | |
"src/assets/styles" | |
"src/components/common" | |
"src/components/auth" | |
"src/components/users" | |
"src/components/contacts" | |
"src/components/settings" | |
"src/views" | |
"src/router" | |
"src/store/modules" | |
) | |
for dir in "${DIRECTORIES[@]}"; do | |
mkdir -p $dir | |
done | |
# Create Vue-specific component and view files | |
VUE_FILES=( | |
"src/components/common/WelcomeNavbar" | |
"src/components/common/WelcomeFooter" | |
"src/components/common/DashboardNavbar" | |
"src/components/common/DashboardSideBar" | |
"src/components/common/DashboardFooter" | |
"src/components/auth/Login" | |
"src/components/auth/Register" | |
"src/components/auth/ForgotPassword" | |
"src/components/auth/ResetPassword" | |
"src/components/auth/VerifyAccount" | |
"src/components/users/UsersList" | |
"src/components/users/AddUser" | |
"src/components/users/EditUser" | |
"src/components/users/RoleAbilities" | |
"src/components/contacts/ContactList" | |
"src/components/contacts/ContactDetail" | |
"src/components/contacts/AddContact" | |
"src/components/contacts/EditContact" | |
"src/components/settings/ManageContactCategories" | |
"src/components/settings/ManageOrganizationCategories" | |
"src/components/settings/ManageSystemSettings" | |
"src/views/Welcome" | |
"src/views/Dashboard" | |
"src/views/Unauthorized" | |
"src/views/NotFound" | |
"src/views/Error" | |
) | |
for file in "${VUE_FILES[@]}"; do | |
touch $file$FILE_EXTENSION | |
done | |
# TypeScript specific files | |
TS_FILES=( | |
"src/router/index.ts" | |
"src/store/index.ts" | |
"src/store/modules/auth.ts" | |
"src/store/modules/rolesAndAbilities.ts" | |
"src/store/modules/contacts.ts" | |
) | |
for file in "${TS_FILES[@]}"; do | |
touch $file | |
done | |
echo "Project structure has been set up in the current directory." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment