File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { BaseCommand, args } from '@adonisjs/ace'
12
12
import { Manifest } from '../src/Manifest'
13
13
import { ADONIS_ACE_CWD } from '../config/env'
14
14
15
+ const sleep = ( timeout : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , timeout ) )
16
+
15
17
/**
16
18
* Invoke post install instructions
17
19
*/
@@ -44,6 +46,19 @@ export default class Invoke extends BaseCommand {
44
46
45
47
const { executeInstructions } = await import ( '@adonisjs/sink' )
46
48
await executeInstructions ( this . name , cwd , this . application )
49
+
50
+ /**
51
+ * When we execute the instructions that updates the `.adonisrc.json` file, we watcher
52
+ * copies it's contents to the `build` directory.
53
+ *
54
+ * Once the copy is in progress, running the ace instructions leads to reading an empty
55
+ * `.adonisrc.json` file.
56
+ *
57
+ * Now there is no simple way to know when the separate process watching and processing
58
+ * files will copy the `.adonisrc.json` file. So we add a small cool off period in
59
+ * between.
60
+ */
61
+ await sleep ( 400 )
47
62
await new Manifest ( cwd , this . logger ) . generate ( )
48
63
}
49
64
}
You can’t perform that action at this time.
0 commit comments