Skip to content

Commit

Permalink
feat: add windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
mike committed Jul 22, 2024
1 parent 1adc37b commit 4b382aa
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc

steps:
- name: Checkout Code
Expand All @@ -49,6 +52,10 @@ jobs:
run: brew install ghostscript
if: matrix.platform.runner == 'macos-latest'

- name: Install ghostscript (for windows)
run: choco install ghostscript
if: matrix.platform.runner == 'windows-latest'

- name: Run tests
run: cargo test --locked --target ${{ matrix.platform.target }}

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
- name: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
- name: win-amd64
runner: windows-latest
target: x86_64-pc-windows-msvc

steps:
- name: Checkout Code
Expand All @@ -49,6 +52,10 @@ jobs:
run: brew install ghostscript
if: matrix.platform.runner == 'macos-latest'

- name: Install ghostscript (for windows)
run: choco install ghostscript
if: matrix.platform.runner == 'windows-latest'

- name: Build
run: cargo build --locked --target ${{ matrix.platform.target }}

Expand Down
8 changes: 7 additions & 1 deletion src/pdf_converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ where
P: AsRef<Path>,
Q: AsRef<Path>,
{
Command::new("gs")
let command = if cfg!(target_os = "windows") {
"gswin64c"
} else {
"gs"
};

Command::new(command)
.args(&[
"-q",
"-dBATCH",
Expand Down

0 comments on commit 4b382aa

Please sign in to comment.