Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
hellofont/invoke.ps1
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
41 lines (33 sloc)
1.38 KB
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
# # 获取当前的Windows身份 | |
# $currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) | |
# # 检查是否拥有管理员权限 | |
# if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
# # 构建用于启动新实例的参数 | |
# $arguments = "& '" + $myinvocation.mycommand.definition + "'" | |
# Start-Process powershell -Verb runAs -ArgumentList $arguments | |
# # 退出当前实例 | |
# exit | |
# } | |
# 创建临时文件夹把hellofont的原始字体复制过来 | |
$appDataPath = $env:AppData | |
$absolutePath = Join-Path -Path $appDataPath -ChildPath "hellofont\CoreSync\plugins\livetype\r\*" | |
New-Item -ItemType Directory -Name "temp" -Force | |
Copy-Item $absolutePath temp -Force | |
$scriptPath = "temp" | |
echo $scriptPath | |
# 获取所有文件,并移除隐藏属性 | |
Get-ChildItem -Path $scriptPath -Force -Filter "*" -Recurse | ForEach-Object { | |
$_.Attributes = $_.Attributes -band -not [System.IO.FileAttributes]::Hidden | |
} | |
# 创建目的地文件夹 | |
New-Item -ItemType Directory -Name "font" -Force | |
Remove-Item font\* -Recurse -Force | |
# 执行脚本处理字体 | |
font-name-detect.exe | |
# python.exe font-name-detect.py | |
# 删除临时文件夹 | |
Remove-Item temp -Recurse -Force | |
# Perform some tasks | |
# Pause the script after tasks are completed | |
Write-Host "Convert finish. Press any key to exit..." | |
Read-Host |