Can't install gactions CLI

巧了我就是萌 提交于 2019-12-23 03:37:15

问题


I'm trying to install the google actions CLI.

The docs: https://developers.google.com/actions/tools/gactions-cli

I followed the commands here as well as from the question/answer here.

I downloaded the Mac x86_64.

Then ran the following command on it: Run chmod +x gactions to make the binary executable.

It did turn the file into an executable. When I clicked it, it opened in terminal and did something.

However in a new tab in terminal it still does not understand the gactions.

Also I don't use terminal but iterm2, so I tried opening the executable in iterm2 and got this error.

How to update $PATH

I placed the gactions file here

My current $PATHs

export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export GOOGLE_SDK_PATH="/Users/leongaban/Projects/YumBrands/GoogleHome"
export TERM="xterm-256color"
export NODE_ENV

回答1:


The gactions file you downloaded is the executable itself - not an installer or anything along those lines. You can put it somewhere in your PATH or call it directly by giving the full path when you're calling it, but it will not be automatically available unless you do so.

You can see your PATH with echo $PATH. If you wish, you can place it in one of those directories.

If you wish to continue to run it out of your Download directory (which I do, since I rarely use the command), you can open an iterm2 command line and call gactions with the full path:

~/Downloads/gactions

or (using your example)

~/Projects/YumBrands/GoogleHome/gactions

Or (also using your example) you could add the following line (probably to your ~/.zshrc file) to reference the gactions command in the GoogleHome directory:

PATH="$PATH:$HOME/Projects/YumBrands/GoogleHome"

You can then open a new terminal or iterm2 window and confirm that this is in your path

echo $PATH

The normal way to use it would be to create a directory where you are developing your Action (I use ~/Documents/Projects) and have gactions create the default action.json file. Possibly something like this:

mkdir ~/Documents/Projects/new-sample-action
cd  ~/Documents/Projects/new-sample-action
~/Downloads/gactions init

(If you have updated your PATH, you can just use gactions init for the last line.)




回答2:


Download gactions

copy downloaded gactions and put into a local Project folder

and then go to your project directory cd "project directory"

run following commands :

$ chmod +x gactions

$ ./gactions init

it will create action.json into your folder




回答3:


Go to the corresponding Path where you have downloaded the gactions file.

chmod +x gactions
./gactions help

You can use gactions by ./gactions. It worked for me.



来源:https://stackoverflow.com/questions/45039531/cant-install-gactions-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!