hydrogen/packages/create-hydrogen-app/scripts/tmp-copy-template-from-dev.js
2021-11-04 15:22:30 -07:00

22 lines
655 B
JavaScript

// @ts-check
/**
* This is a temporary script meant to copy `packages/dev` to `./template-hydrogen`
* while we are actively developing H2 in `dev`. Eventually, the template will just
* live in this folder.
*/
const path = require('path');
const fs = require('fs');
const {copy} = require('./utils');
const devPath = path.resolve(__dirname, '..', '..', 'dev');
const templatePath = path.resolve(__dirname, '..', './template-hydrogen');
const skipFiles = ['node_modules', 'dist'];
// Remove the symlink and replace it with a folder
fs.unlinkSync(templatePath);
fs.mkdirSync(templatePath, {recursive: true});
copy(devPath, templatePath, skipFiles);