@@ -72,7 +72,13 @@ function exec( command, args, options = {} ) {
7272 console . error ( '\nCommand errors:' ) ;
7373 console . error ( stderr ) ;
7474 }
75- reject ( new Error ( `${ command } ${ args . join ( ' ' ) } failed with code ${ code } ` ) ) ;
75+ reject (
76+ new Error (
77+ `${ command } ${ args . join (
78+ ' '
79+ ) } failed with code ${ code } `
80+ )
81+ ) ;
7682 } else {
7783 resolve ( ) ;
7884 }
@@ -134,7 +140,9 @@ async function main() {
134140 // Read Gutenberg ref from package.json
135141 let ref ;
136142 try {
137- const packageJson = JSON . parse ( fs . readFileSync ( packageJsonPath , 'utf8' ) ) ;
143+ const packageJson = JSON . parse (
144+ fs . readFileSync ( packageJsonPath , 'utf8' )
145+ ) ;
138146 ref = packageJson . gutenberg ?. ref ;
139147
140148 if ( ! ref ) {
@@ -156,13 +164,24 @@ async function main() {
156164 try {
157165 // Generic shallow clone approach that works for both branches and commit hashes
158166 // 1. Clone with no checkout and shallow depth
159- await exec ( 'git' , [ 'clone' , '--depth' , '1' , '--no-checkout' , GUTENBERG_REPO , 'gutenberg' ] ) ;
167+ await exec ( 'git' , [
168+ 'clone' ,
169+ '--depth' ,
170+ '1' ,
171+ '--no-checkout' ,
172+ GUTENBERG_REPO ,
173+ 'gutenberg' ,
174+ ] ) ;
160175
161176 // 2. Fetch the specific ref with depth 1 (works for branches, tags, and commits)
162- await exec ( 'git' , [ 'fetch' , '--depth' , '1' , 'origin' , ref ] , { cwd : gutenbergDir } ) ;
177+ await exec ( 'git' , [ 'fetch' , '--depth' , '1' , 'origin' , ref ] , {
178+ cwd : gutenbergDir ,
179+ } ) ;
163180
164181 // 3. Checkout FETCH_HEAD
165- await exec ( 'git' , [ 'checkout' , 'FETCH_HEAD' ] , { cwd : gutenbergDir } ) ;
182+ await exec ( 'git' , [ 'checkout' , 'FETCH_HEAD' ] , {
183+ cwd : gutenbergDir ,
184+ } ) ;
166185
167186 console . log ( '✅ Cloned successfully' ) ;
168187 } catch ( error ) {
@@ -177,10 +196,14 @@ async function main() {
177196 console . log ( `\n📡 Fetching and checking out: ${ ref } ` ) ;
178197 try {
179198 // Fetch the specific ref (works for branches, tags, and commit hashes)
180- await exec ( 'git' , [ 'fetch' , '--depth' , '1' , 'origin' , ref ] , { cwd : gutenbergDir } ) ;
199+ await exec ( 'git' , [ 'fetch' , '--depth' , '1' , 'origin' , ref ] , {
200+ cwd : gutenbergDir ,
201+ } ) ;
181202
182203 // Checkout what was just fetched
183- await exec ( 'git' , [ 'checkout' , 'FETCH_HEAD' ] , { cwd : gutenbergDir } ) ;
204+ await exec ( 'git' , [ 'checkout' , 'FETCH_HEAD' ] , {
205+ cwd : gutenbergDir ,
206+ } ) ;
184207
185208 console . log ( '✅ Checked out successfully' ) ;
186209 } catch ( error ) {
@@ -190,7 +213,9 @@ async function main() {
190213
191214 // Install dependencies
192215 console . log ( '\n📦 Installing dependencies...' ) ;
193- const nodeModulesExists = fs . existsSync ( path . join ( gutenbergDir , 'node_modules' ) ) ;
216+ const nodeModulesExists = fs . existsSync (
217+ path . join ( gutenbergDir , 'node_modules' )
218+ ) ;
194219
195220 if ( ! nodeModulesExists ) {
196221 console . log ( ' (This may take a few minutes on first run)' ) ;
0 commit comments