Giter VIP home page Giter VIP logo

Comments (4)

lread avatar lread commented on August 26, 2024

Ya, I think lein.bat is a better choice too.
Works with all shells.

Are there any advantages to lein.ps1?

from setup-clojure.

ikappaki avatar ikappaki commented on August 26, 2024

Hi,

I have just also stumbled upon this independently and was about to raise an issue 😅

this should be considered a bug IMHO . lein cannot be found when trying to invoke it on the cmd shell

'lein' is not recognized as an internal or external command,
operable program or batch file.

The expecation here is I think that the action should work with any shell.

To reproduce

  1. Setup GH action for MS-Windows that installs lein with setup-clojure and calls lein version on the powershell, pwsh and cmd shells
  test-lein-cmd:
    runs-on: windows-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Prepare java
        uses: actions/setup-java@v3
        with:
          distribution: 'zulu'
          java-version: '8'

      - name: Install lein
        uses: DeLaGuardo/[email protected]
        with:
          lein: '2.9.10'

      - name: lein powershell
        shell: powershell
        run: |
          lein version

      - name: lein pwsh
        shell: pwsh
        run: |
          lein version

      - name: lein cmd
        shell: cmd
        run: |
          lein version
  1. Run the GH action, you should see tha the powershell and pwsh succeed but cmd fails (only showing the latter below)
2022-11-20T17:22:49.2775007Z ##[group]Run lein version
2022-11-20T17:22:49.2775419Z lein version
2022-11-20T17:22:49.2810382Z shell: C:\Windows\system32\cmd.EXE /D /E:ON /V:OFF /S /C "CALL "{0}""
2022-11-20T17:22:49.2810728Z env:
2022-11-20T17:22:49.2811669Z   JAVA_HOME: C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.352-8\x64
2022-11-20T17:22:49.2812093Z   JAVA_HOME_8_X64: C:\hostedtoolcache\windows\Java_Zulu_jdk\8.0.352-8\x64
2022-11-20T17:22:49.2812531Z   LEIN_HOME: C:\hostedtoolcache\windows\Leiningen\2.9.10-9-5\x64
2022-11-20T17:22:49.2812865Z ##[endgroup]
2022-11-20T17:22:49.3016487Z 'lein' is not recognized as an internal or external command,
2022-11-20T17:22:49.3017128Z operable program or batch file.
2022-11-20T17:22:49.3044548Z ##[error]Process completed with exit code 1.

The solution here is either to replace the .ps1 script with https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein.bat as pointed out by @borkdude, or install the .bat script alongside the .ps1 file. I suppose tha latter option, to answer @lread's question, has the advantage that when running a job with PowerShell (the default shell on GH actions) it will still use the ps1 script which will give slightly better perfofrmance than spawning a new conhost to execute the batch script.

Thanks

from setup-clojure.

DeLaGuardo avatar DeLaGuardo commented on August 26, 2024

Instead of choosing one from lein.ps1 and lein.bat, I decided to use both :) This should fix the issue. Feel free to reopen in case something isn't working

from setup-clojure.

borkdude avatar borkdude commented on August 26, 2024

Thanks! Will try soon

from setup-clojure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.