Hari Das
Hari Das

Reputation: 10849

ScriptApp.getService().getUrl() returns an invalid URL which does not open

I was trying to publish GAS as web app from script itself. I tried following code.

function publish(){
  var service = ScriptApp.getService();
  if(!service.isEnabled()){
     service.enable(service.Restriction.ALL);
  }
  var url = service.getUrl();
  Logger.log(url);
}

Surprisingly this returns an URL which is fake. If I go to that URL nothing opens. But if I manually go to the script-editor and save a new version and publish the app from the modal popup, then again running above code returns the correct URL. What may be the cause ? Is not it a potential BUG in app script ?

Upvotes: 0

Views: 2721

Answers (1)

Arun Nagarajan
Arun Nagarajan

Reputation: 5645

This is a known issue - https://code.google.com/p/google-apps-script-issues/issues/detail?id=1703

Please star that to get more updates on it. At this point there is no way to programmatically deploy a web app.

Upvotes: 4

Related Questions