cromshell
cromshell copied to clipboard
add a command to open a browser page for the execution bucket
If you want a quick version of this that's portable, I wrote a function to do exactly this:
function openGsPath()
{
P=""
if [[ $# -eq 0 ]] ; then
P=$( sed -e \
'[/^http[s]*/ {
s#^http[s]*://console.cloud.google.com/storage/browser/#GSREP#
s#^http[s]*://console.cloud.google.com/#GSREP#
s#^http[s]*://storage.cloud.google.com/#GSREP#
}
/^gs:\/\// {
s#^gs://#HTTPSREP#
}
/^GSREP/ {
s#^GSREP#gs://#
}
/^HTTPSREP/ {
s#HTTPSREP#https://console.cloud.google.com/storage/browser/#
}' -e 's#gs://_details/#gs://#' -e 's#?.*##' - )
else
P=$( echo "${1}" | sed -e \
'/^http[s]*/ {
s#^http[s]*://console.cloud.google.com/storage/browser/#GSREP#
s#^http[s]*://console.cloud.google.com/#GSREP#
s#^http[s]*://storage.cloud.google.com/#GSREP#
}
/^gs:\/\// {
s#^gs://#HTTPSREP#
}
/^GSREP/ {
s#^GSREP#gs://#
}
/^HTTPSREP/ {
s#HTTPSREP#https://console.cloud.google.com/storage/browser/#
}' -e 's#gs://_details/#gs://#' -e 's#?.*##' )
fi
echo $P
open ${P}
}
Put that in a shell file and source it when you log in. Then you can do openGsPath GSURL and it'll open a browser page to that location.
Someday when I clean up my dotfiles, I'll make them public so anyone can use this…
I have a poor-man's solution ... What I meant was to actually have the command open up the page directly by providing the workflow/submission ID. Right now, we'd have to click-click-click to get to that "folder", or manually figure out the bucket and folder/prefix.