File tree 1 file changed +4
-4
lines changed
packages/sanity/src/_internal/cli/commands/migration
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -76,12 +76,12 @@ const createMigrationCommand: CliCommandDefinition<CreateMigrationFlags> = {
76
76
. replace ( / \s + / g, '-' )
77
77
. replace ( / [ ^ a - z 0 - 9 - ] / g, '' )
78
78
79
- const destDir = path . join ( MIGRATIONS_DIRECTORY , sluggedName )
79
+ const destDir = path . join ( workDir , MIGRATIONS_DIRECTORY , sluggedName )
80
80
if ( existsSync ( destDir ) ) {
81
81
if (
82
82
! ( await prompt . single ( {
83
83
type : 'confirm' ,
84
- message : `Migration directory ./ ${ destDir } already exists. Overwrite?` ,
84
+ message : `Migration directory ${ chalk . cyan ( destDir ) } already exists. Overwrite?` ,
85
85
default : false ,
86
86
} ) )
87
87
) {
@@ -100,14 +100,14 @@ const createMigrationCommand: CliCommandDefinition<CreateMigrationFlags> = {
100
100
101
101
const definitionFile = path . join ( destDir , 'index.ts' )
102
102
103
- await writeFile ( path . join ( workDir , definitionFile ) , renderedTemplate )
103
+ await writeFile ( definitionFile , renderedTemplate )
104
104
// To dry run it, run \`sanity migration run ${sluggedName}\``)
105
105
output . print ( )
106
106
output . print ( `${ chalk . green ( '✓' ) } Migration created!` )
107
107
output . print ( )
108
108
output . print ( 'Next steps:' )
109
109
output . print (
110
- `Open ./ ${ chalk . bold (
110
+ `Open ${ chalk . bold (
111
111
definitionFile ,
112
112
) } in your code editor and write the code for your migration.`,
113
113
)
You can’t perform that action at this time.
0 commit comments