@@ -22,6 +22,7 @@ const installEdition = (edition, config, projectDir) => {
2222 * 4. Do custom post-install procedures for different core editions:
2323 * 4.1 Copy gulpfile.js for edition-node-gulp
2424 * 4.2 Copy scripts for edition-node
25+ * 4.3 Copy items for edition-twig
2526 */
2627 const sourceDir = config . paths . source . root ;
2728 yield checkAndInstallPackage ( edition ) ; // 1
@@ -52,6 +53,29 @@ const installEdition = (edition, config, projectDir) => {
5253 ) ;
5354 break ;
5455 }
56+ // 4.3
57+ case '@pattern-lab/edition-twig' : {
58+ const editionPath = path . resolve ( './node_modules' , edition ) ;
59+ const editionConfigPath = path . resolve (
60+ editionPath ,
61+ 'patternlab-config.json'
62+ ) ;
63+ const editionConfig = require ( editionConfigPath ) ;
64+
65+ pkg . scripts = Object . assign (
66+ { } ,
67+ pkg . scripts || { } ,
68+ yield getJSONKey ( edition , 'scripts' )
69+ ) ;
70+
71+ yield copyAsync (
72+ path . resolve ( editionPath , 'alter-twig.php' ) ,
73+ path . resolve ( sourceDir , '../' , 'alter-twig.php' )
74+ ) ;
75+
76+ config = merge ( config , editionConfig ) ;
77+ break ;
78+ }
5579 }
5680 yield writeJsonAsync ( path . resolve ( projectDir , 'package.json' ) , pkg , {
5781 spaces : 2 ,
0 commit comments