This commit is contained in:
Rao 2025-03-05 08:30:42 +08:00
parent 0959e43b20
commit 7e79e8aca2
2 changed files with 3 additions and 4 deletions

View File

@ -41,12 +41,11 @@ export class InitService {
const existingTaxonomies = await db.taxonomy.findMany(); const existingTaxonomies = await db.taxonomy.findMany();
const existingTaxonomyMap = new Map( const existingTaxonomyMap = new Map(
existingTaxonomies.map((taxonomy) => [taxonomy.name, taxonomy]), existingTaxonomies.map((taxonomy) => [taxonomy.slug, taxonomy]),
); );
for (const [index, taxonomy] of InitTaxonomies.entries()) { for (const [index, taxonomy] of InitTaxonomies.entries()) {
const existingTaxonomy = existingTaxonomyMap.get(taxonomy.name); const existingTaxonomy = existingTaxonomyMap.get(taxonomy.slug);
if (!existingTaxonomy) { if (!existingTaxonomy) {
// Create new taxonomy // Create new taxonomy
await db.taxonomy.create({ await db.taxonomy.create({

View File

@ -14,7 +14,7 @@ done
# Check if the index.html file exists before processing # Check if the index.html file exists before processing
if [ -f "/usr/share/nginx/html/index.html" ]; then if [ -f "/usr/share/nginx/html/index.html" ]; then
# Use envsubst to replace environment variable placeholders # Use envsubst to replace environment variable placeholders
envsubst < /usr/share/nginx/html/index.html > /usr/share/nginx/html/index.html.tmp envsubst < /usr/share/nginx/html/index.temp > /usr/share/nginx/html/index.html.tmp
mv /usr/share/nginx/html/index.html.tmp /usr/share/nginx/html/index.html mv /usr/share/nginx/html/index.html.tmp /usr/share/nginx/html/index.html
else else
echo "Info: /usr/share/nginx/html/index.html does not exist , skip replace env" echo "Info: /usr/share/nginx/html/index.html does not exist , skip replace env"