Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
- cd dirname "$0"
- cd ../..
- #https://linuxize.com/post/bash-check-if-file-exists/
- FILE=XYZ.Root
- if [! -d "$FILE"]; then
- mkdir $FILE
- fi
- FILE2=XYZ.Root/Assets
- if [! -d "$FILE2"]; then
- mkdir $FILE2
- fi
- FILE3=XYZ.Root/Assets/Games
- if [! -d "$FILE3"]; then
- mkdir $FILE3
- fi
- GIT_ATT=/.gitattributes
- GIT_IGN=/.gitignore
- ROOT_PACKAGES=/XYZ.Root/Packages
- PROJ_SETT=/XYZ.Root/ProjectSettings
- #https://stackoverflow.com/questions/97875/rm-rf-equivalent-for-windows
- #https://stackoverflow.com/questions/38932431/using-rm-rf-with-a-directory
- rm -rf /XYZ.Root/Assets/Oculus
- rm -rf /XYZ.Root/Assets/Plugins
- rm -rf /XYZ.Root/Assets/XYZ
- rm -rf /XYZ.Root/Assets/ProjectSettings
- #https://stackoverflow.com/questions/1951742/how-can-i-symlink-a-file-in-linux
- #I'm not familiar with junctions, I'm not sure if this is windows only or just over my head.
- #This block will make basic symlinks between your 2 locations, check out the man page for ln
- #if you need further options. Sorry.
- ln -s /XYZ.Root/Assets/Oculus /SubModules/XYZ.Modules/Assets/Oculus
- ln -s /XYZ.Root/Assets/Plugins /SubModules/XYZ.Modules/Assets/Plugins
- ln -s /XYZ.Root/Assets/XYZ /SubModules/XYZ.Modules/Assets/XYZ
- ln -s /XYZ.Root/Assets/Resources /SubModules/XYZ.Modules/Assets/Resources
- ROOT_ACCESS=/XYZ.Root/Assets
- cd SubModulesXYZ
- #setlocal
- for f in dir do
- name='basename "$0"' #I'm assuming you're looking at filenames, this may be wrong
- str1=$name
- if [! $str1 eq "str1"] then
- #copy
- fi
- #I'm not sure what's going on here, you're on your own
- # for %%A in (%%f) do set "vara=%%~nA" & set "varb_plus=%%~xA"
- # for /f "delims=. tokens=1" %%B in ("!varb_plus!") do (
- # if exist "%%f\Assets\%%B" (
- # if "!str1:Games=!" == "!str1!" (mklink /j %ROOT_ASSETS%\%%B %%f\Assets\%%B
- # ) else (mklink /j %ROOT_ASSETS%\Games\%%B %%f\Assets\%%B)
- # )
- # )
- if [?? eq ??] then
- #copy $GIT_IGN to f
- rm -rf /f/Assets/Oculus
- rm -rf /f/Assets/Plugins
- rm -rf /f/Assets/XYZ
- rm -rf /f/Assets/ProjectSettings
- ln -s /f/Assets/Oculus ./XYZ.Modules/Assets/Oculus
- ln -s /f/Assets/Plugins ./XYZ.Modules/Assets/Plugins
- ln -s /f/Assets/XYZ ./XYZ.Modules/Assets/XYZ
- ln -s /f/Assets/Resources ./XYZ.Modules/Assets/Resources
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement