Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
name: config.name,
description: config.description,
statusfyVersion: pkg.version
}
})
),
{ spaces: " " }
);
// .gitignore
fse.copySync(
path.join(__dirname, "init", "_gitignore"),
path.join(outDir, ".gitignore")
);
logger.success(
`A new project of Statusfy was successfully created at ${chalk.cyan(
outDir
)}`
);
logger.warn(
`Remember to run ${chalk.cyan(`${answers.packageManager} install`)}`
);
});
};
const lang = locale.code;
const calPath = path.join(
this.options.generate.dir,
"calendars",
`scheduled.${locale.code}.ics`
);
const content = await createCalendar(statusfyOptions.siteConfig, lang);
// Ensure no calendar file exists
await fse.remove(calPath);
await fse.ensureFile(calPath);
await fse.writeFile(calPath, content);
logger.success(`Generated /calendars/scheduled.${locale.code}.ics`);
}
}
});
};
await copyPublicFiles(
statusfyOptions.publicFilesPath,
this.options.generate.dir
);
/* Sitemap */
const sitemap = await createSitemap(statusfyOptions.siteConfig);
const xmlPath = path.join(this.options.generate.dir, "sitemap.xml");
// Ensure no sitemap file exists
await fse.remove(xmlPath);
await fse.ensureFile(xmlPath);
await fse.writeFile(xmlPath, sitemap);
logger.success("Generated /sitemap.xml");
/* Feeds */
if (
statusfyOptions.siteConfig.notifications &&
statusfyOptions.siteConfig.notifications.feeds
) {
// eslint-disable-next-line no-unused-vars
for (const locale of statusfyOptions.locales) {
const feeds = await createFeeds(
statusfyOptions.siteConfig,
locale.code
);
const rssPath = path.join(
this.options.generate.dir,
"feeds",
deletedFiles.push(localeIncidentPath);
} catch (error) {
logger.error(error);
}
} else {
logger.warn(`This file couldn't be found:\n${localeIncidentPath}`);
}
}
if (deletedFiles.length > 0) {
const prefix =
deletedFiles.length === 1
? "This file was successfully deleted"
: "These files were successfully deleted";
logger.success(`${prefix}: \n${deletedFiles.join("\n")}`);
}
}
} catch (error) {
logger.fatal(error);
}
});
};
} else {
fse.outputFileSync(
filePath,
`${content}\n\n`
);
createdFiles.push(path.relative(contentPath, filePath));
if (answers.open) {
opener(filePath);
}
}
});
if (!error) {
logger.success(
`The Incident was successfully created.\n${createdFiles.join("\n")}`
);
} else {
logger.warn("There was an issue in creating the Incident.");
}
} catch (error) {
logger.fatal(error);
}
});
};
updatedFiles.push(localeIncidentPath);
} catch (error) {
logger.error(error);
}
} else {
logger.warn(`This file couldn't be found:\n${localeIncidentPath}`);
}
}
if (updatedFiles.length > 0) {
const prefix =
updatedFiles.length === 1
? "This file was successfully updated"
: "These files were successfully updated";
logger.success(`${prefix}: \n${updatedFiles.join("\n")}`);
}
}
} catch (error) {
logger.fatal(error);
}
});
};