Finally I found how to do it looking to Python code of googlecl
. What you need is to build a script that do the following:
#!/bin/bash -l
#$ -S /bin/bash
#S -N $1
export GOOGLE_DOC=$1
#!Then do whahever you need to do with the google file
This script is just taking the value of the first argument (which will be the path to the google doc that you want to edit by doing whatever with it). Then all what you need is to call to googlecl
like this:
google docs edit --title GOOGLE_DOC_TITLE --format FORMAT --editor SCRIPT_WE_JUST_BUILD
GoogleCl
is creating a temporary file in your system and is passing to the editor
(our script) the path to that temporary file. So what we are getting is the path to the temporary file.
Whenever yoy finish googlecl
will look if there is any change in that file and will upload it if YES
.