@@ -6,7 +6,7 @@ import type { NetlifyAPI } from '@netlify/api'
6
6
7
7
import { listSites } from '../../lib/api.js'
8
8
import { startSpinner } from '../../lib/spinner.js'
9
- import { chalk , logAndThrowError , exit , log , APIError } from '../../utils/command-helpers.js'
9
+ import { chalk , logAndThrowError , exit , log , APIError , netlifyCommand } from '../../utils/command-helpers.js'
10
10
import getRepoData from '../../utils/get-repo-data.js'
11
11
import { ensureNetlifyIgnore } from '../../utils/gitignore.js'
12
12
import { track } from '../../utils/telemetry/index.js'
@@ -23,7 +23,9 @@ const findSiteByRepoUrl = async (api: NetlifyAPI, repoUrl: string): Promise<Site
23
23
if ( sites . length === 0 ) {
24
24
spinner . error ( )
25
25
return logAndThrowError (
26
- `You don't have any projects yet. Run ${ chalk . cyanBright ( 'netlify sites:create' ) } to create a project.` ,
26
+ `You don't have any projects yet. Run ${ chalk . cyanBright (
27
+ `${ netlifyCommand ( ) } sites:create` ,
28
+ ) } to create a project.`,
27
29
)
28
30
}
29
31
@@ -92,7 +94,7 @@ const linkPrompt = async (command: BaseCommand, options: LinkOptionValues): Prom
92
94
}
93
95
94
96
log ( )
95
- log ( `${ chalk . cyanBright ( 'netlify link' ) } will connect this folder to a project on Netlify` )
97
+ log ( `${ chalk . cyanBright ( ` ${ netlifyCommand ( ) } link` ) } will connect this folder to a project on Netlify` )
96
98
log ( )
97
99
const { linkType } = await inquirer . prompt < { linkType : string | undefined } > ( [
98
100
{
@@ -142,8 +144,8 @@ const linkPrompt = async (command: BaseCommand, options: LinkOptionValues): Prom
142
144
if ( ! matchingSites || matchingSites . length === 0 ) {
143
145
return logAndThrowError ( `No project names found containing '${ searchTerm } '.
144
146
145
- Run ${ chalk . cyanBright ( 'netlify link' ) } again to try a new search,
146
- or run ${ chalk . cyanBright ( 'netlify sites:create' ) } to create a project.` )
147
+ Run ${ chalk . cyanBright ( ` ${ netlifyCommand ( ) } link` ) } again to try a new search,
148
+ or run ${ chalk . cyanBright ( `npx ${ netlifyCommand ( ) } sites:create` ) } to create a project.` )
147
149
}
148
150
149
151
if ( matchingSites . length > 1 ) {
@@ -183,7 +185,9 @@ or run ${chalk.cyanBright('netlify sites:create')} to create a project.`)
183
185
184
186
if ( ! sites || sites . length === 0 ) {
185
187
return logAndThrowError (
186
- `You don't have any projects yet. Run ${ chalk . cyanBright ( 'netlify sites:create' ) } to create a project.` ,
188
+ `You don't have any projects yet. Run ${ chalk . cyanBright (
189
+ `${ netlifyCommand ( ) } sites:create` ,
190
+ ) } to create a project.`,
187
191
)
188
192
}
189
193
@@ -271,7 +275,7 @@ export const link = async (options: LinkOptionValues, command: BaseCommand) => {
271
275
// Site id is incorrect
272
276
if ( siteId && isEmpty ( siteInfo ) ) {
273
277
log ( `"${ siteId } " was not found in your Netlify account.` )
274
- log ( `Please double check your project ID and which account you are logged into via \`netlify status\`.` )
278
+ log ( `Please double check your project ID and which account you are logged into via \`${ netlifyCommand ( ) } status\`.` )
275
279
return exit ( )
276
280
}
277
281
@@ -281,7 +285,7 @@ export const link = async (options: LinkOptionValues, command: BaseCommand) => {
281
285
log ( `Project already linked to "${ initialSiteData . name } "` )
282
286
log ( `Admin url: ${ initialSiteData . admin_url } ` )
283
287
log ( )
284
- log ( `To unlink this project, run: ${ chalk . cyanBright ( 'netlify unlink' ) } ` )
288
+ log ( `To unlink this project, run: ${ chalk . cyanBright ( ` ${ netlifyCommand ( ) } unlink` ) } ` )
285
289
} else if ( options . id ) {
286
290
try {
287
291
// @ts -expect-error FIXME(serhalp): Mismatch between hardcoded `SiteInfo` and new generated Netlify API types.
0 commit comments