-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmove-dist.js
More file actions
24 lines (19 loc) · 767 Bytes
/
move-dist.js
File metadata and controls
24 lines (19 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const fs = require('fs');
const path = require('path');
const distPath = path.resolve(__dirname, 'dist/angular');
const browserPath = path.join(distPath, 'browser');
if (fs.existsSync(browserPath)) {
console.log(`Moving files from ${browserPath} to ${distPath}...`);
const files = fs.readdirSync(browserPath);
files.forEach(file => {
const src = path.join(browserPath, file);
const dest = path.join(distPath, file);
// Move file/dir
fs.renameSync(src, dest);
});
// Remove empty browser dir
fs.rmdirSync(browserPath);
console.log('Move complete. Assets are now at the root of dist/angular.');
} else {
console.log(`No browser directory found at ${browserPath}. Files might already be at root.`);
}