Actions on Google - Mac gactions won't run - actions-on-google

I am trying to set up the Actions sdk as described here:
https://developers.google.com/actions/sdk
I downloaded gactions for a Mac 64-bit machine. If I try to open the file, it opens as text. When I am in the folder containing gactions, I try to run gactions init and get the response:
-bash: gactions: command not found
Any thoughts?

Try this:
Download Google gactions cli from gaction CLI
On Mac and Linux, to make the binary executable run from terminal:
$ cd folder_with_gactions
$ chmod +x gactions
Execute gactions
$ cd folder_with_gactions
$ ./gactions init
Also, you may find this tutorial interesting if you are trying to create an action in Google Home : How to create a custom private Google Home Action with API.AI and Google App Engine. In STEP 8 you can find an example of gactions.

If you have already setup google-cloud-sdk correctly, then you can drop the gactions file into the google-cloud-sdk/bin folder. Alternatively, you can add a path to bash directly to the folder you have gactions.

To add the gactions command CLI location to the System Paths:
Use “Go to the Folder” option of Finder, to search “~/.bash_profile”
Open the File “~/.bash_profile”
 in edit mode and add the following command, at the top the file, Save and Close.
export PATH="$PATH:$HOME/gactionsCLI"
Note: Above path refers to the folder which contains the executable
file “Unix Executable”
Restart the Terminal and try the commands

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

Ensure you run chmod +x gactions to make the binary executable
Copy the binary executable into the project directory
Run ./gactions init from the terminal/command line

Related

How to view code coverage as html in Windows?

I did flutter test --coverage
A lcov.info was generated under coverage
I want to convert this into html but I don't find a tool for Windows.
On linux, you just do:
sudo apt-get update -qq -y
sudo apt-get install lcov -y
Then you do
genhtml coverage/lcov.info -o coverage/html
I am on Windows and
'genhtml' is not recognized as an internal or external command,
operable program or batch file.
Ok I found it. I will leave the anwser here in case it maybe helpful for anyone.
Actually genhtml is a perl script. If you are have git bash installed, you should have perl already. Try where perl on the cmd and it will show you the path.
For me it was at C:\Program Files\Git\usr\bin\perl.exe
Now create a file called genhtml.perl inside your flutter project root directory. (Make sure to .gitignore it)
Then in the file, copy and paste the content this https://raw.githubusercontent.com/valbok/lcov/master/genhtml.perl
Finally open git bash and run $ ./genhtml.perl ./coverage/lcov.info -o coverage/html .
Check You are done html files at coverage/html.
On android studio, select index.html then CTRL+SHIFT+C to copy the file path.
Open Chrome and on the url bar add file:///+CTRL+V. Tap enter. You are done.
PS : Who so ever is facing an error like No common filename prefix found! or some other issue, they can try replacing content of genhtml.perl file from below link.
https://raw.githubusercontent.com/linux-test-project/lcov/master/bin/genhtml

Flutter error:unable to find git path in windows

I've just tried to install Flutter on windows 10. When I try to run a flutter command (flutter doctor), I'm getting
Error: Unable to find git in your PATH.
I have set the path to both git and flutter and tried adding the following to path
C:\Program Files\Git\bin\git.exe;C:\Windows\System32
How can I resolve this???
Go to my flutter installation folder and inside flutter/bin edit the flutter.bat file using a text editor and remove the line (Line 33 in mine) that says
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The code should look like this on those lines
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
REM Test if Git is available on the Host
where /q git || ECHO Error: Unable to find git in your PATH. && EXIT /B 1
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
You could try reinstalling Git with "Use Git and optional unix tools from the command prompt" selected in the installer.
This would add git and the unix tools to the path. You may have installed with only 'Use Git from Bash only' selected?
Find the flutter.bat in your flutter folder which should be inside flutter/bin and edit the flutter.bat using your text editor.
Remove the below line from the file (Mine was Line 33)
IF EXIST "%mingit_path%" SET PATH=%PATH%;%mingit_path%
The file should look like this after you remove it
REM If available, add location of bundled mingit to PATH
SET mingit_path=%FLUTTER_ROOT%\bin\mingit\cmd
Save and Run flutter doctor and everything should work fine.
I guess its something to do with the path variables being confused.
Before
After
Set the path up to bin
C:\Program Files\Git\bin
then try
git --version
if still not working, reinstall git
check these two threads for the further issues
SO
GH
It turns out I didn't have git installed
https://git-scm.com/downloads
https://git-scm.com/downloads

How to perform silent installation using git bash

I am using git bash to perform installation of exe file.
my git bash located into below location
C:\Program Files\Git\bin\bash.exe
I opened that bash.exe and try to install my exe as below
$ ./Setup.exe /silent
But it still popup me for user indirection during installation .
and same command is working fine if I will execute using C:\cygwin64

Set Permanent Flutter Path

The steps for modifying this variable permanently for all terminal sessions are machine-specific. Typically you add a line to a file that is executed whenever you open a new window. For example:
Determine the directory where you placed the Flutter SDK. You will need this in Step 3.
Open (or create) $HOME/.bash_profile. The file path and filename might be different on your machine.
Add the following line and change [PATH_TO_FLUTTER_GIT_DIRECTORY] to be the path where you cloned Flutter’s git repo:
$ export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
Run source $HOME/.bash_profile to refresh the current window.
Verify that the flutter/bin directory is now in your PATH by running:
echo $PATH
In mac, you should add it as follows in ".zshrc":
export PATH="$PATH:/Users/matteo/Documents/flutter/bin"
After you have updated the ".zshrc" file, run this command to ensure changes have been notified to OS
source ~/.zshrc
Reference: https://flutter.dev/docs/get-started/install/macos
A similar concept is for Linux system using bash files
I tried a lot of methods but this one permanent solution worked for me like a charm:
open Terminal in your Mac: type:
sudo nano /echo/paths
Add the code to the file:
/users/yourUserName/flutter/bin
Save the file using Control+X and Press Y and Enter
Hope this helps! :)

How to install nano using GitBash in Windows 10?

I am trying to install nano editor. From all the previous posts, I am stuck on path. What is path? How do I fix put my path?
I have:
$ mv nano ~/path/to/git/share
$ nano abc
bash: nano: command not found
You can add it via chocolatey.
choco install nano
PATH is the environment variable which is used to locate an executable you want to run.
See "How to permanently set $PATH on Linux?": you can add the folder where nano is in your .bashrc (which you can create directly under %USERPROFILE%, used by Git bash as $HOME)
Add to ~/.bashrc:
export PATH=$PATH:~/path/to/git/share
Then type
source ~/.bashrc
If you don't want to add it to your PATH, you can follow this step-by-step procedure, which does include the installation of nano-git-0d9a7347243.exe.
If your ultimate goal is to have and use nano on Windows 10, you can download the nano installer from here and just install the .msi file the usual Windows way. No manual path configurations required.