Skip to content

Commit 790e7d3

Browse files
authored
Added support for usernames with spaces.
If a Windows user has a space character in the username, 1. `userprofile` breaks into 2 variables and must be saved with `" "`. 2. `call :copy_config` is supplied with an argument but if there is a space in the argument value, it breaks into 2 arguments. 3. command `xcopy /s configs C:\Users\John Doe` is also supplied with 2 arguments because of the space character.
1 parent 06aabce commit 790e7d3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

install.bat

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ echo Installing Square IntelliJ configs...
44

55
setlocal enableDelayedExpansion
66

7-
for /D %%i in (%userprofile%\.AndroidStudio*) do call :copy_config %%i
8-
for /D %%i in (%userprofile%\.IdeaIC*) do call :copy_config %%i
9-
for /D %%i in (%userprofile%\.IntelliJIdea*) do call :copy_config %%i
7+
for /D %%i in ("%userprofile%"\.AndroidStudio*) do call :copy_config "%%i"
8+
for /D %%i in ("%userprofile%"\.IdeaIC*) do call :copy_config "%%i"
9+
for /D %%i in ("%userprofile%"\.IntelliJIdea*) do call :copy_config "%%i"
1010

1111
echo.
1212
echo Restart IntelliJ and/or AndroidStudio, go to preferences, and apply 'Square' or 'SquareAndroid'.
@@ -15,8 +15,8 @@ exit /b
1515
REM sub function for copy config files
1616
:copy_config
1717
set config_dir=%~1\config
18-
echo Installing to !config_dir!
19-
xcopy /s configs !config_dir!
18+
echo Installing to "!config_dir!"
19+
xcopy /s configs "!config_dir!"
2020
echo Done.
2121
echo.
2222
exit /b

0 commit comments

Comments
 (0)