代码之家  ›  专栏  ›  技术社区  ›  albert

在github操作中使用ghostscript gswin64c/gswin32c

  •  0
  • albert  · 技术社区  · 4 年前

    我正在尝试将gswin64c(gswin32c也可以,但是下面的小脚本也会产生同样的问题)用于GitHub操作,但是在安装包之后,仍然找不到gswin64c可执行文件

    jobs:
      build:
        name: ${{ matrix.config.name }}
        runs-on: ${{ matrix.config.os }}
        strategy:
          fail-fast: false
          matrix:
            config:
            - {
                name: "Windows Latest MSVC Debug",
                os: windows-latest,
                build_type: "Debug", cc: "cl", cxx: "cl",
                build_gen: "NMake Makefiles"
              }
        steps:
        - name: Install Ghostscript (Windows)
          run:
            choco install ghostscript
          if: matrix.config.os == 'windows-latest'
    
        - name: Check tool versions (Windows)
          shell: bash
          run: |
            echo "=== ghostscript 64 bit ===";
            gswin64c --version;
          if: matrix.config.os == 'windows-latest'
    

     === ghostscript 64 bit ===
    D:\a\_temp\2690ee6c-4c94-4de6-9dac-3f11a4aee19e.sh: line 19: gswin64c: command not found
    Error: Process completed with exit code 127.
    
    • 我做错什么了?
    • 也可以考虑替代安装
    0 回复  |  直到 4 年前
        1
  •  0
  •   albert    4 年前

    看起来添加是第二步:

        - name: Setting Ghostscript paths (Windows)
          shell: bash
          run: |
            echo "C:/Program Files (x86)/gs/gs9.53.3/bin/" >> $GITHUB_PATH
            echo "C:/Program Files/gs/gs9.53.3/bin/" >> $GITHUB_PATH
            export PATH="/c/Program Files (x86)/gs/gs9.53.3/bin/:$PATH"
            export PATH="/c/Program Files/gs/gs9.53.3/bin/:$PATH"
          if: matrix.config.os == 'windows-latest'
    

    使gswin64c可用。