fix: 修复打印函数缺少 try 块导致 macOS 编译失败;CI 自动安装 Git bash
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,15 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Git (bash)
|
||||||
|
shell: powershell
|
||||||
|
run: |
|
||||||
|
if (-not (Get-Command bash -ErrorAction SilentlyContinue)) {
|
||||||
|
winget install Git.Git --source winget --accept-source-agreements --accept-package-agreements
|
||||||
|
$env:PATH = "C:\Program Files\Git\bin;$env:PATH"
|
||||||
|
[System.Environment]::SetEnvironmentVariable('PATH', $env:PATH, 'Machine')
|
||||||
|
}
|
||||||
|
|
||||||
- name: Compile (Flutter Windows)
|
- name: Compile (Flutter Windows)
|
||||||
shell: bash
|
shell: bash
|
||||||
run: sh scripts/ci/compile-windows.sh "${{ gitea.ref_name }}"
|
run: sh scripts/ci/compile-windows.sh "${{ gitea.ref_name }}"
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ Future<void> printProductLabelImpl({
|
|||||||
String shopAddress = '',
|
String shopAddress = '',
|
||||||
String shopPhone = '',
|
String shopPhone = '',
|
||||||
}) async {
|
}) async {
|
||||||
|
try {
|
||||||
final font = await _loadFont();
|
final font = await _loadFont();
|
||||||
final doc = pw.Document();
|
final doc = pw.Document();
|
||||||
final qrImage = pw.MemoryImage(qrBytes);
|
final qrImage = pw.MemoryImage(qrBytes);
|
||||||
@@ -382,6 +383,7 @@ pw.Widget _sig(pw.Font font, pw.Font bold, String label) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> printStockInOrderImpl(StockInOrder order) async {
|
Future<void> printStockInOrderImpl(StockInOrder order) async {
|
||||||
|
try {
|
||||||
final font = await _loadFont();
|
final font = await _loadFont();
|
||||||
final bold = await _loadBoldFont();
|
final bold = await _loadBoldFont();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user