Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install.cmd: support pyenv, fix potential %CD% bugs #152

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions windows/install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ WHERE python /q || (
GOTO :ERROR
)

WHERE pip.exe /q || (
WHERE pip /q || (
ECHO.
ECHO Pip.exe not found, install or add to PATH
ECHO Pip not found, install or add to PATH
ECHO.
GOTO :ERROR
)

ECHO Ensuring the latest FontTools is installed.

pip.exe install --upgrade fonttools
call pip install --upgrade fonttools

WHERE ttx /q || (
ECHO.
Expand All @@ -60,23 +60,23 @@ WHERE ttx /q || (
PUSHD %TEMP%
IF EXIST %MS_EMOJI_FONT_PATH% (
ECHO Creating new Segoe UI Emoji font from Twitter Color Emoji
ttx -t "name" -o "emjname.ttx" %MS_EMOJI_FONT_PATH% || GOTO :ERROR
ttx -o %FINAL_EMJ_FONT_PATH% -m %EMOJI_FONT_PATH% "emjname.ttx" || GOTO :ERROR
DEL "emjname.ttx"
call ttx -t "name" -o "emjname.ttx" %MS_EMOJI_FONT_PATH% || GOTO :ERROR
call ttx -o %FINAL_EMJ_FONT_PATH% -m %EMOJI_FONT_PATH% "%CD%\emjname.ttx" || GOTO :ERROR
DEL "%CD%\emjname.ttx"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to know why or if the %CD is necessary, otherwise it should be removed

Copy link

@win98se win98se May 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%cd% means “current directory”. @Tenrys said that some commands were ignoring the pushd, so they added the %cd%s accordingly.

They could probably explain more about how it didn't work in their case, and the “before and after” results of %cd% additions.

Copy link
Author

@Tenrys Tenrys May 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are two screenshots to illustrate why I added usage of %CD%.

%CD% absent:

(Do note that ttx also fails, as can be seen by the first error message in the picture)

WindowsTerminal_Wgj0wx9C5K

%CD% present:

WindowsTerminal_XjnoRmKWCi

I don't know if the fact that I am calling install.cmd from PowerShell has any incidence on it, but it should make it more reliable in that case if it does.

)

ECHO Creating new Segoe UI Symbol font from Twitter Color Emoji
REM Merge Segoe UI Symbol into TwitterColorEmoji, this keeps
REM TwitterColorEmoji's glyph ids intact for the 'SVG ' table data
pyftmerge %EMOJI_FONT_PATH% %MS_FONT_PATH%
call pyftmerge %EMOJI_FONT_PATH% %MS_FONT_PATH%
ECHO Dumping SVG emojis
ttx -t "SVG " -o "svg.ttx" %EMOJI_FONT_PATH% || GOTO :ERROR
ttx -t "name" -o "name.ttx" %MS_FONT_PATH% || GOTO :ERROR
call ttx -t "SVG " -o "svg.ttx" %EMOJI_FONT_PATH% || GOTO :ERROR
call ttx -t "name" -o "name.ttx" %MS_FONT_PATH% || GOTO :ERROR
ECHO Merging in dumped emojis
ttx -o "almost.ttf" -m "merged.ttf" "name.ttx" || GOTO :ERROR
call ttx -o "almost.ttf" -m "merged.ttf" "name.ttx" || GOTO :ERROR
DEL "merged.ttf"
DEL "name.ttx"
ttx -o %FINAL_FONT_PATH% -m "almost.ttf" "svg.ttx" || GOTO :ERROR
call ttx -o %FINAL_FONT_PATH% -m "almost.ttf" "svg.ttx" || GOTO :ERROR
DEL "almost.ttf"
DEL "svg.ttx"
REM Get back to working directory.
Expand Down