Skip to content

Commit

Permalink
chore(git): checkout shell scripts with LF line endings, and *.bat wi…
Browse files Browse the repository at this point in the history
…th CRLF

Closes #35
  • Loading branch information
lotem committed Sep 7, 2020
1 parent 20c4ffa commit 2c233db
Show file tree
Hide file tree
Showing 7 changed files with 519 additions and 514 deletions.
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto
*.bat text eol=crlf
*.conf text eol=lf
*.sh text eol=lf
rime-install text eol=lf
6 changes: 3 additions & 3 deletions all-packages.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
set package_list=
call preset-packages.bat
call extra-packages.bat
set package_list=
call preset-packages.bat
call extra-packages.bat
32 changes: 16 additions & 16 deletions extra-packages.bat
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
set package_list=%package_list%^
array^
cantonese^
combo-pinyin^
double-pinyin^
emoji^
ipa^
jyutping^
middle-chinese^
pinyin-simp^
quick^
scj^
soutzoe^
stenotype^
wubi^
wugniu^
set package_list=%package_list%^
array^
cantonese^
combo-pinyin^
double-pinyin^
emoji^
ipa^
jyutping^
middle-chinese^
pinyin-simp^
quick^
scj^
soutzoe^
stenotype^
wubi^
wugniu^
16 changes: 8 additions & 8 deletions preset-packages.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set package_list=%package_list%^
bopomofo^
cangjie^
essay^
luna-pinyin^
prelude^
stroke^
terra-pinyin^
set package_list=%package_list%^
bopomofo^
cangjie^
essay^
luna-pinyin^
prelude^
stroke^
terra-pinyin^
112 changes: 56 additions & 56 deletions rime-install-bootstrap.bat
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
@echo off

setlocal

set root_dir=%~dp0
set PATH=%root_dir%;%PATH%

set script_path=%root_dir%rime-install.bat
set config_path=%root_dir%rime-install-config.bat

rem download rime-install.bat if missing
if exist "%script_path%" goto end_download

where /q curl
if %errorlevel% equ 0 (
set downloader=curl -fsSL
set save_to=-o
goto downloader_found
)

where /q powershell
if %errorlevel% equ 0 (
set downloader=powershell Invoke-WebRequest
set save_to=-OutFile
goto downloader_found
)

echo Error: downloader not found.
exit /b 1
:downloader_found

set script_url=https://git.io/rime-install.bat
set config_url=https://github.com/rime/plum/raw/master/rime-install-config.bat

echo Downloading rime-install.bat ...
%downloader% "%script_url%" %save_to% "%script_path%"
if errorlevel 1 (
echo Error downloading rime-install.bat
exit /b 1
)

if exist "%config_path%" goto end_download

echo Downloading rime-install-config.bat template ...
%downloader% "%config_url%" %save_to% "%config_path%"
if errorlevel 1 (
echo Error downloading rime-install-config.bat
exit /b 1
)

:end_download

set link_name=Rime package installer

rem create shortcut
powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%root_dir%%link_name%.lnk');$s.TargetPath='\"%ComSpec%\"';$s.Arguments='/k \"%script_path%\"';$s.WorkingDirectory='%root_dir%';$s.Save()"
@echo off

setlocal

set root_dir=%~dp0
set PATH=%root_dir%;%PATH%

set script_path=%root_dir%rime-install.bat
set config_path=%root_dir%rime-install-config.bat

rem download rime-install.bat if missing
if exist "%script_path%" goto end_download

where /q curl
if %errorlevel% equ 0 (
set downloader=curl -fsSL
set save_to=-o
goto downloader_found
)

where /q powershell
if %errorlevel% equ 0 (
set downloader=powershell Invoke-WebRequest
set save_to=-OutFile
goto downloader_found
)

echo Error: downloader not found.
exit /b 1
:downloader_found

set script_url=https://git.io/rime-install.bat
set config_url=https://github.com/rime/plum/raw/master/rime-install-config.bat

echo Downloading rime-install.bat ...
%downloader% "%script_url%" %save_to% "%script_path%"
if errorlevel 1 (
echo Error downloading rime-install.bat
exit /b 1
)

if exist "%config_path%" goto end_download

echo Downloading rime-install-config.bat template ...
%downloader% "%config_url%" %save_to% "%config_path%"
if errorlevel 1 (
echo Error downloading rime-install-config.bat
exit /b 1
)

:end_download

set link_name=Rime package installer

rem create shortcut
powershell "$s=(New-Object -COM WScript.Shell).CreateShortcut('%root_dir%%link_name%.lnk');$s.TargetPath='\"%ComSpec%\"';$s.Arguments='/k \"%script_path%\"';$s.WorkingDirectory='%root_dir%';$s.Save()"
36 changes: 18 additions & 18 deletions rime-install-config.bat
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
rem Location of download cache
rem set download_cache_dir=%TEMP%

rem China mirror for downloading Git for Windows installer
rem set git_mirror=taobao

rem Do not update packages; only download missing files.
rem CAUTION: may suffer from incomplete downloads.
rem set no_update=1

rem Location of Rime configuration manager and downloaded packages
rem set plum_dir=%APPDATA%\plum

rem Location of Rime user directory
rem set rime_dir=%APPDATA%\Rime

rem Disable /plum/ bash script; use batch installer only.
rem set use_plum=0
rem Location of download cache
rem set download_cache_dir=%TEMP%

rem China mirror for downloading Git for Windows installer
rem set git_mirror=taobao

rem Do not update packages; only download missing files.
rem CAUTION: may suffer from incomplete downloads.
rem set no_update=1

rem Location of Rime configuration manager and downloaded packages
rem set plum_dir=%APPDATA%\plum

rem Location of Rime user directory
rem set rime_dir=%APPDATA%\Rime

rem Disable /plum/ bash script; use batch installer only.
rem set use_plum=0
Loading

0 comments on commit 2c233db

Please sign in to comment.