Cheerio, command not found - cheerio

I am trying to use cheerio in a bash script. No matter how I install it I cannot get cheerio to be a command that can be executed on the command line
Is it not meant to work this way? I'm confused.

Related

'ALGOLIA_API_KEY' not recognized as an internal or external command

I am trying to run algolia for the first time but it seems that there is something wrong with my environment. I followed the detailed explanation here https://community.algolia.com/jekyll-algolia/getting-started.html.
I installed and configured everything that is needed from the previous steps but when I run the command
ALGOLIA_API_KEY=xxxxxxxxxxxxxx bundle exec jekyll algolia
I get an error:
'ALGOLIA_API_KEY' is not recognized as an internal or external command,
operable program or batch file.
I have been rereading the documentation for both jekyll and angolia but couldn't find anything that could be helpful.
Since you're running on Windows, you cannot set an environment variable for your command like you can do on UNIX.
As advised in this question, Setting and using variable within same command line in Windows cmd.exe, I believe you could use
set ALGOLIA_API_KEY=xxxxxxxxxxxxxx && bundle exec jekyll algolia

How to run 'polymer build' in visualstudio.com

I could, after a lot of effort, create a step in the job where I install (correctly) the polymer CLI.
Now I would like to build my client project, but I tried with command lines, npm commands, whatever, I couldn't find the correct definition to obtain a proper build.
In this picture, I show the error that happens in the command line 'polymer build'.
How could I obtain the desired result?
Thanks in advance...
The Tool is polymer and Arguments is build:

vim-rest-console displays JSON in a single line

I've found out about vim-rest-console, but after installed and run a test, I noticed the JSON it outputs is only in one line, without any indentation. This is horrible and I'd like to know if there is a way to solve this. I am using NeoVim on Xubuntu 16.04 LTS.
To fix the json indentation in Vim, put the following command to your .vimrc
nmap =j :%!python -m json.tool<CR>
and launch it via the =j command (or remap to different shortcut).

STAF: How do I redirect the output of the process started by STAF to hudson console instantaneously?

I am starting a ruby command from a batch file using STAF.
STAF $TESTMACHINE process start command ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts"
This batch file is triggered by a Hudson job. But my observation is that the print/puts of the ruby files appear in the hudson console only after the completion of the execution of the ruby script [Hudson job]. This way I can not make out if something is going wrong in the script execution unless the job completes.
Also, I understand that if I remove RETURNSTDERR RETURNSTDOUT, the ruby script's output is displayed in the STAF console on the target machine. So STAF is the one which is sending back the ruby outputs to the hudson console.
Now can I use any option with STAF to get the ruby output spontaneously to the hudson console?
Thanks for reading this lengthy question :)
You can use SSH instead of STAF for such task.
It seems with STAF it's a little bit tricky and could be done with OUTPUT option.
If you have shared storage, for example NFS share called /nfs on hudson server and d:\nfs on Windows, the following hudson job should work:
STAF $TESTMACHINE process start command ruby "C:\MyProject\scripts\MasterScript.rb" WAIT SAMECONSOLE RETURNSTDERR RETURNSTDOUT WORKDIR "C:\MyProject\scripts" OUTPUT "d:\nfs\hudson.log" &
tail --pid=$! -f /nfs/hudson.log

Beginning Lua: How to call functions from terminal on Mac OS?

I'm new to Lua and work around with some tutorials, try some basic stuff like coding common algorithms etc.
But I have some trouble while using the lua interpreter on my mac os machine.
For example let's say we have a file called 'sample.lua', holds the code line:
function fib(n) return n<2 and n or fib(n-1)+fib(n-2) end
How do I run that function from terminal?
If I don't use any function, I just call the script with 'lua script.lua' - works!
Next question points on the basic understanding between the usage of non-compiled and compiled lua-source. Why is lua code run without compiling, like I mentioned before (lua script.lua)? Or will this statement compile the code temporarily and run afterwards?
Thanks in advance
chris
You can run lua from the terminal with the -i flag:
lua -i luascript.lua
This will execute the script and then put the interpreter into interactive mode. Then you could call the function right from the interactive prompt:
fib(3)
To run that function from the terminal, you would have to do something like:
lua -e"dofile'sample.lua' print(fib(3))"
The -e there just tells it to execute the following string, which loads your file 'sample.lua' and then prints the result of fib(3) to stdout.
I don't know the answer to your second question though.
Lua scripts are always compiled into Lua VM instructions before running. Precompiled scripts just skip this step.