Giter VIP home page Giter VIP logo

Comments (7)

tomy0000000 avatar tomy0000000 commented on June 9, 2024

Thanks for reporting this.

I'm currently on vacation now, I'll take a look whenever I'm available. If you already have ideas on fixing, you can draft a PR.

from coinc.

tomy0000000 avatar tomy0000000 commented on June 9, 2024

@kamusis I just uploaded an v2 release candidate, please help test it out and share your upgrade experience (There should be dialogue indicate to a help page). If everything went well, I'll drop the pre-release tag.

from coinc.

kamusis avatar kamusis commented on June 9, 2024

@tomy0000000 Thank you for the fixing. First of all, all the "cur" command looks perfect now, running smoothly in python3!

but I'm not sure why you decide to check a hardcoding python3 path: /usr/local/bin/python3?
In "V2 migration guide", you mentioned only support homebrew, but on my laptop, python3 is in

❯ which python3
/opt/homebrew/bin/python3

I'm using M1 silicon Macbook Pro, I believed that the default PATH has been changed between homebrew for x86 and for ARM.

My suggestion:
change "cur" script to:

if command -v python3 1>/dev/null 2>&1; then
	python3 main.py convert $1
else
    echo '{
  "items": [
    {
      "title": "Manual Upgrade is required",
      "subtitle": "Hit enter to open migration Guide on GitHub",
      "valid": true,
      "arg": "open,https://github.com/tomy0000000/Coinc/wiki/V2-Migration-Guide",
      "icon": {
        "path": "hints/info.png"
      }
    }
  ]
}'
fi

In workflow environment variables page, add a PATH variables, you can fill both python3 default path for x86 and ARM into it.
image

BTW: cur-add/cur-rm/cur-arr are also leaved in python not python3.

from coinc.

tomy0000000 avatar tomy0000000 commented on June 9, 2024

I'm using M1 silicon Macbook Pro, I believed that the default PATH has been changed between homebrew for x86 and for ARM.

The reason I decided to use the fixed path is to ensure that the python3 being used is indeed provided by homebrew. Therefore, I'm much prefer to hard code the path rather than having user to figure out how to configure.

I adapt [these] from homebrew installation script, which should be good enough to generate dynamic path. This is what I end up having:

UNAME_MACHINE="$(/usr/bin/uname -m)"
if [[ "${UNAME_MACHINE}" == "arm64" ]]
then
  HOMEBREW_PREFIX="/opt/homebrew"
else
  HOMEBREW_PREFIX="/usr/local"
fi

if command -v "$HOMEBREW_PREFIX/bin/python3" 1>/dev/null 2>&1; then
	$HOMEBREW_PREFIX/bin/python3 main.py convert $1
else
    echo '{
  "items": [
    {
      "title": "Manual Upgrade is required",
      "subtitle": "Hit enter to open migration Guide on GitHub",
      "valid": true,
      "arg": "open,https://github.com/tomy0000000/Coinc/wiki/V2-Migration-Guide",
      "icon": {
        "path": "hints/info.png"
      }
    }
  ]
}'
fi

BTW: cur-add/cur-rm/cur-arr are also leaved in python not python3.

That's my mistake, will fix it

I've updated the pre-release, please check it again if you will. :)

from coinc.

kamusis avatar kamusis commented on June 9, 2024

UNAME_MACHINE="$(/usr/bin/uname -m)"

check the infra at first is a good method. should be no problem.

I've updated the pre-release, please check it again if you will. :)

I tested the latest version, cur-add/cur-rm/cur-arr are not working, the error still is "python: command not found".
I modified 3 places manually, changed python to python3, now it's OK.
image

from coinc.

tomy0000000 avatar tomy0000000 commented on June 9, 2024

I tested the latest version, cur-add/cur-rm/cur-arr are not working, the error still is "python: command not found".
I modified 3 places manually, changed python to python3, now it's OK.

That is my mistake again, because there is no exception or error detection mechanism built on workflow part, so I did not spot those changes not applying during my own test.

rc3 should fix this issue now :)

from coinc.

kamusis avatar kamusis commented on June 9, 2024

Hi tommy, thank you again for the quick response and this amazing workflow 💯
I'll close the issue.

from coinc.

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.