0

I'm writing a bash script, and I need to get from within the terminal current workspace URL and the cloud9 user email.

I've tried:

  • Extracting the data from hostname variable, but it's not the workspace domain.
  • Extracting it from the .c9 project folders, but the domain and user email doesn't seem to appear there

Any ideas how could I get these details from within the c9 terminal?

BenB
  • 2,747
  • 3
  • 29
  • 54
  • What's the issue you're having with extracting it from the hostname? The hostname should be username-workspacename-workspaceid. Just scrap the id then use workspacename-username.c9users.io for the preview URL. For the workspace URL you'll want https://ide.c9.io/username/workspacename – Brady Dowling Jan 09 '17 at 19:27

1 Answers1

1

on hosted workspaces you can use $C9_* environment variables, try

echo $C9_EMAIL $C9_FULLNAME $C9_HOSTNAME $C9_PROJECT 
a user
  • 23,300
  • 6
  • 58
  • 90