kopia lustrzana https://github.com/shoelace-style/shoelace
Use more generic cache dir
rodzic
cfe70b8cfe
commit
9220158a8e
|
@ -19,8 +19,8 @@ log.txt
|
||||||
*.sublime-project
|
*.sublime-project
|
||||||
*.sublime-workspace
|
*.sublime-workspace
|
||||||
|
|
||||||
|
.cache/
|
||||||
.stencil/
|
.stencil/
|
||||||
.icons/
|
|
||||||
.idea/
|
.idea/
|
||||||
.vscode/
|
.vscode/
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
.github
|
.github
|
||||||
.icons
|
.cache
|
||||||
.stencil
|
.stencil
|
||||||
dist
|
dist
|
||||||
docs/assets
|
docs/assets
|
||||||
|
|
|
@ -14,20 +14,20 @@ let numIcons = 0;
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const version = require('./node_modules/bootstrap-icons/package.json').version;
|
const version = require('./node_modules/bootstrap-icons/package.json').version;
|
||||||
const srcPath = `./.icons/icons-${version}`;
|
const srcPath = `./.cache/icons/icons-${version}`;
|
||||||
const url = `https://github.com/twbs/icons/archive/v${version}.zip`;
|
const url = `https://github.com/twbs/icons/archive/v${version}.zip`;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fs.stat(`${srcPath}/LICENSE.md`);
|
await fs.stat(`${srcPath}/LICENSE.md`);
|
||||||
console.log(chalk.cyan('Generating icons from cache... ♻️'));
|
console.log(chalk.cyan('Generating icons from cache ♻️'));
|
||||||
} catch {
|
} catch {
|
||||||
// Download the source from GitHub (since not everything is published to NPM)
|
// Download the source from GitHub (since not everything is published to NPM)
|
||||||
console.log(chalk.cyan(`Downloading and extracting Bootstrap Icons ${version}... 📦`));
|
console.log(chalk.cyan(`Downloading and extracting Bootstrap Icons ${version} 📦`));
|
||||||
await download(url, './.icons', { extract: true });
|
await download(url, './.cache/icons', { extract: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy icons
|
// Copy icons
|
||||||
console.log(chalk.cyan(`Copying icons and license... 🚛`));
|
console.log(chalk.cyan(`Copying icons and license 🚛`));
|
||||||
await del(['./src/components/icon/icons']);
|
await del(['./src/components/icon/icons']);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
copy(`${srcPath}/icons`, './src/components/icon/icons'),
|
copy(`${srcPath}/icons`, './src/components/icon/icons'),
|
||||||
|
@ -36,7 +36,7 @@ let numIcons = 0;
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Generate metadata
|
// Generate metadata
|
||||||
console.log(chalk.cyan(`Generating icon metadata... 🏷`));
|
console.log(chalk.cyan(`Generating icon metadata 🏷`));
|
||||||
const files = await glob(`${srcPath}/docs/content/icons/**/*.md`);
|
const files = await glob(`${srcPath}/docs/content/icons/**/*.md`);
|
||||||
|
|
||||||
const metadata = await Promise.map(files, async file => {
|
const metadata = await Promise.map(files, async file => {
|
||||||
|
|
Ładowanie…
Reference in New Issue