JamieMason / ImageOptim-CLI

Make optimisation of images part of your automated build process
https://foldleft.io/image-tools
MIT License
3.45k stars 126 forks source link

Manual Installation #124

Closed stefanuswjy closed 8 years ago

stefanuswjy commented 8 years ago

Basically, I'm a designer with a limited understanding of coding. I've follow your instructions about manual installation and usage. But, it didn't work. The terminal says the -bash: imageoptim: command not found

imageoptim 1 imageoptim 2

This would be a lifesaver for me if it works. But, I'm facing a huge knowledge barrier :( ps: sorry for my bad english

JamieMason commented 8 years ago

Sorry about this @stefanuswjy, it appears the manual installation instructions are not correct.

Please try the following;

# create a folder at ~/imageoptim-cli and browse to it
mkdir "${HOME}/imageoptim-cli" && cd "$_"

# download and extract that zip in our new folder
curl --output imageoptim-cli.zip https://codeload.github.com/JamieMason/ImageOptim-CLI/zip/1.14.8
unzip imageoptim-cli.zip

# move the files from our version folder up into ~/imageoptim-cli
mv ImageOptim-CLI-1.14.8/* .

# add this new folder to where terminal looks for programs to run
export PATH=$PATH:"$PWD/bin"
stefanuswjy commented 8 years ago

Hi @JamieMason , is it correct that the folder should arranged like this? folder iamgeoptim

and, what the 4th step mean? i still dont get it :( # add this new folder to where terminal looks for programs to run export PATH=$PATH:"$PWD/bin"

JamieMason commented 8 years ago

I think you might have run some of the commands from the wrong location – the commands we're running are relative to the current folder your terminal is in at the time.

Delete that imageoptim-cli folder and let's try it with absolute paths;

# create a folder at ~/imageoptim-cli 
mkdir "${HOME}/imageoptim-cli"

# browse to it
cd "${HOME}/imageoptim-cli"

# download imageoptim-cli into it
curl --output "${HOME}/imageoptim-cli/imageoptim-cli.zip" https://codeload.github.com/JamieMason/ImageOptim-CLI/zip/1.14.8

# unzip package
unzip "${HOME}/imageoptim-cli/imageoptim-cli.zip"

# move the files from our version folder up into ~/imageoptim-cli
mv "${HOME}/imageoptim-cli/ImageOptim-CLI-1.14.8/*" "${HOME}/imageoptim-cli"

can you run echo $PATH and show me what it says please?

stefanuswjy commented 8 years ago

it says: echo path

JamieMason commented 8 years ago

Open up ~/.bash_profile and add somewhere in that file;

# Add imageoptim-cli to the $PATH
export PATH="$PATH:$HOME/imageoptim-cli/bin"

Then restart your Terminal.

If it worked, if you run imageoptim -v it should show the version 1.14.8.

JamieMason commented 8 years ago

Please let me know if this worked so I can close the issue or give you more help @stefanuswjy.

stefanuswjy commented 8 years ago

Hi @JamieMason , i'm stuck on move the files from our version folder up into ~/imageoptim-cli it says No such file or directory and also when i open up ~/.bash_profile, it says No such file or directory too. sorry for late reply :(

why

JamieMason commented 8 years ago

I think the simplest thing would be to download https://nodejs.org 6.3.0 and then run npm install -g imageoptim-cli in your Terminal.

This avoids the technical aspects of going the manual route.

stefanuswjy commented 8 years ago

yeahhh, it worked !!! Thankyou @JamieMason :)

success

btw, does the imageoptim-cli has expired date? or i can use it continuously?

JamieMason commented 8 years ago

great 😄

btw, does the imageoptim-cli has expired date? or i can use it continuously?

No expiry or anything. If a new version of imageoptim-cli is released and you want to update your copy, you can just run npm install -g imageoptim-cli again to get the new version.

stefanuswjy commented 8 years ago

Thanks a lot @JamieMason . This imageoptim-cli would be my lifesaver :)

JamieMason commented 8 years ago

great to hear, thanks @stefanuswjy.