|
7 | 7 | */
|
8 | 8 |
|
9 | 9 | import * as fs from 'fs/promises';
|
10 |
| -import * as process from 'process'; |
| 10 | +import { repository } from './functions/determine-repository'; |
11 | 11 | import { repositoryConfig } from './data/repository-config';
|
12 | 12 | import { purgeCss } from './functions/purge-css';
|
13 | 13 | import { updateContent } from './functions/update-content';
|
14 | 14 |
|
15 |
| -// Process args |
16 |
| -const params: Record<string, string> = {}; |
17 |
| -process.argv.slice(2).forEach(val => { |
18 |
| - const [key, value] = val.split('='); |
19 |
| - |
20 |
| - if (key.startsWith('--')) { |
21 |
| - params[key.slice(2)] = value; |
22 |
| - } |
23 |
| -}); |
24 |
| - |
25 |
| -// Determine repository information |
26 |
| -let repository = repositoryConfig.default; |
27 |
| -if (params.repository && repositoryConfig[params.repository]) { |
28 |
| - repository = repositoryConfig[params.repository]; |
29 |
| - console.log('Using repository information:', repository); |
30 |
| -} |
| 15 | +console.log('Using repository information:', repository); |
31 | 16 |
|
32 | 17 | // Determine source CSS name
|
33 | 18 | let sourceCss: string;
|
@@ -67,7 +52,7 @@ const copyTheme = async ({
|
67 | 52 |
|
68 | 53 | const init = async () => {
|
69 | 54 | try {
|
70 |
| - const containsValidation = repository.name === repositoryConfig.portal.name || repository.name === repositoryConfig.community.name; |
| 55 | + const containsValidation = repository.name === repositoryConfig.portal.name || repository.name === repositoryConfig.community.name || repository.name === repositoryConfig.hub.name; |
71 | 56 |
|
72 | 57 | // Define arrays for parallel tasks
|
73 | 58 | const parallelTasksInitial = [
|
@@ -200,7 +185,7 @@ const init = async () => {
|
200 | 185 | }
|
201 | 186 |
|
202 | 187 | // ESLint and tsconfig - needed if repository contains it's own assets along with choco-theme
|
203 |
| - if (repository.name === repositoryConfig.portal.name) { |
| 188 | + if (repository.playwright || repository.name === repositoryConfig.portal.name || repository.name === repositoryConfig.hub.name) { |
204 | 189 | parallelTasksInitial.push(
|
205 | 190 | {
|
206 | 191 | task: '.eslintrc.js',
|
@@ -254,7 +239,7 @@ const init = async () => {
|
254 | 239 |
|
255 | 240 | // Change CSS content
|
256 | 241 | // Font Awesome
|
257 |
| - if (repository.name === repositoryConfig.portal.name || repository.language === 'astro') { |
| 242 | + if (repository.name === repositoryConfig.portal.name || repository.name === repositoryConfig.hub.name || repository.language === 'astro') { |
258 | 243 | console.log('🚀 Updating Font Awesome font path...');
|
259 | 244 | await updateContent({
|
260 | 245 | destination: repository.css,
|
@@ -294,7 +279,7 @@ const init = async () => {
|
294 | 279 | }
|
295 | 280 |
|
296 | 281 | // PurgeCSS
|
297 |
| - if (repository.name !== repositoryConfig.portal.name) { |
| 282 | + if (repository.name !== repositoryConfig.portal.name && repository.name !== repositoryConfig.hub.name) { |
298 | 283 | await purgeCss({
|
299 | 284 | source: `${repository.css}${repository.name}.min.css`,
|
300 | 285 | repository: repository
|
|
0 commit comments