Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong path used to launch AppleScript scripts #163

Closed
1 of 8 tasks
nicolinuxfr opened this issue May 14, 2018 · 9 comments
Closed
1 of 8 tasks

Wrong path used to launch AppleScript scripts #163

nicolinuxfr opened this issue May 14, 2018 · 9 comments

Comments

@nicolinuxfr
Copy link

Types of Changes

What types of changes does your issue require? Put an x in all the boxes that apply:

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code
  • refactor: A code change that neither fixes a bug or adds a feature
  • perf: A code change that improves performance
  • test: Adding missing tests
  • chore: Changes to the build process or auxiliary tools/libraries

Description

After installing the latest version of ImageOptim using npm, I have the following error when I try to activate JPEG mini :

! Command failed: osascript /Users/nicolas/osascript/is-installed.applescript com.icvt.JPEGmini-Pro
osascript: /Users/nicolas/osascript/is-installed.applescript: No such file or directory

! Please raise an issue at https://github.com/JamieMason/ImageOptim-CLI/issues

    Error: Command failed: osascript /Users/nicolas/osascript/is-installed.applescript com.icvt.JPEGmini-Pro
    osascript: /Users/nicolas/osascript/is-installed.applescript: No such file or directory


        at makeError (/usr/local/lib/node_modules/imageoptim-cli/dist/imageoptim:10024:9)
        at Promise.all.then.arr (/usr/local/lib/node_modules/imageoptim-cli/dist/imageoptim:10129:16)
        at process._tickCallback (internal/process/next_tick.js:178:7)

I checked, and indeed, I have no osascripts folder inside my home folder.

Setup

macOS High Sierra 10.13.4
npm 5.10.0
node 10.1.0
JPEGmini standard 2.2.1

@JamieMason
Copy link
Owner

Thanks @nicolinuxfr, am I right that you've followed the manual installation? This is an oversight on my part because the osascript directory is needed as well as the binary. Could you confirm though incase I'm on the wrong track? Thanks a lot.

@nicolinuxfr
Copy link
Author

Nope, I used the recommended way : npm install -g imageoptim-cli

I tried with and without sudo, for information.

@JamieMason
Copy link
Owner

oh...oh dear 😄 I am on a different machine now to the one I developed the new version in so I will install it here and see if I can reproduce it.

@JamieMason
Copy link
Owner

JamieMason commented May 14, 2018

this is the problem line

const getScriptPath = (name: string) => resolve(__dirname, `../osascript/${name}.applescript`);

I think using https://github.com/nexe/nexe to create a self contained executable is causing __dirname to not behave in the way I would expect. I'll get this fixed urgently.

@nicolinuxfr
Copy link
Author

Great news if you can fix it easily. :-)

@JamieMason
Copy link
Owner

I seem to have it working locally, will release soon.

@JamieMason
Copy link
Owner

Please give 2.0.2 a try and reopen if there are still issues, thanks.

@nicolinuxfr
Copy link
Author

Works great with 2.0.2, thanks for the quick fix ! 👍

@JamieMason
Copy link
Owner

you're welcome Nicolas, it was a big one so it needed sorting ASAP 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants