@@ -61,17 +61,20 @@ export const command = new Command('create-script')
6161 const spinnerMsg = intl . formatMessage ( {
6262 defaultMessage : 'Creating script...' ,
6363 } ) ;
64- const { parentId} = await withSpinner (
64+ const { parentId, scriptId } = await withSpinner (
6565 spinnerMsg ,
6666 async ( ) => await clasp . project . createWithContainer ( name , mimeType ) ,
6767 ) ;
68- const url = `https://drive.google.com/open?id=${ parentId } ` ;
68+ const parentUrl = `https://drive.google.com/open?id=${ parentId } ` ;
69+ const scriptUrl = `https://script.google.com/d/${ scriptId } /edit` ;
6970 const successMessage = intl . formatMessage (
7071 {
71- defaultMessage : 'Created new container : {url }' ,
72+ defaultMessage : 'Created new document : {parentUrl}{br}Created new script: {scriptUrl }' ,
7273 } ,
7374 {
74- url,
75+ parentUrl,
76+ scriptUrl,
77+ br : '\n' ,
7578 } ,
7679 ) ;
7780 console . log ( successMessage ) ;
@@ -80,14 +83,20 @@ export const command = new Command('create-script')
8083 defaultMessage : 'Creating script...' ,
8184 } ) ;
8285 const scriptId = await withSpinner ( spinnerMsg , async ( ) => await clasp . project . createScript ( name , parentId ) ) ;
83-
84- const url = `https://script.google.com/d/${ scriptId } /edit` ;
86+ const parentUrl = `https://drive.google.com/open?id= ${ parentId } ` ;
87+ const scriptUrl = `https://script.google.com/d/${ scriptId } /edit` ;
8588 const successMessage = intl . formatMessage (
8689 {
87- defaultMessage : 'Created new script: {url}' ,
90+ defaultMessage : `Created new script: {scriptUrl}{parentId, select,
91+ undefined {}
92+ other {{br}Bound to document: {parentUrl}}
93+ }` ,
8894 } ,
8995 {
90- url,
96+ parentId,
97+ parentUrl,
98+ scriptUrl,
99+ br : '\n' ,
91100 } ,
92101 ) ;
93102 console . log ( successMessage ) ;
0 commit comments