Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
`);
};
const invalidateCloudFrontCache = () => {
if (deployedDomain && props.parserMode === PARSER_MODES.MODE_DEPLOY) {
require("../../../infrastructure-scripts/dist/infra-comp-utils/sls-libs").invalidateCloudFrontCache(domain);
}
}
const hostedZoneName = domain !== undefined ? extractDomain(domain.toString()) : {};
/** post build function to write to the .env file that the domain has been deployed */
const writeDomainEnv = () => {
//console.log("check for >>writeDomainEnv<<");
// we only write to the .env file when we are in domain mode, i.e. this script creates the domain
// and we did not yet deployed the domain previously
if (!deployedDomain && props.parserMode === PARSER_MODES.MODE_DOMAIN) {
require('fs').appendFileSync(
path.join(
require("../../../infrastructure-scripts/dist/infra-comp-utils/system-libs").currentAbsolutePath(),
".env"),
`\nDOMAIN_${props.stage}=TRUE`
);
}
// check whether we already created the domain of this environment
const deployedDomain = process.env[`DOMAIN_${props.stage}`] !== undefined;
const domain = childConfigs.map(config => config.domain).reduce((result, domain) => result !== undefined ? result : domain, undefined);
const certArn = childConfigs.map(config => config.certArn).reduce((result, certArn) => result !== undefined ? result : certArn, undefined);
const invalidateCloudFrontCache = () => {
if (deployedDomain && props.parserMode === PARSER_MODES.MODE_DEPLOY) {
require("../../../infrastructure-scripts/dist/infra-comp-utils/sls-libs").invalidateCloudFrontCache(domain);
}
}
const hostedZoneName = domain !== undefined ? extractDomain(domain.toString()) : {};
/** post build function to write to the .env file that the domain has been deployed */
const writeDomainEnv = () => {
//console.log("check for >>writeDomainEnv<<");
// we only write to the .env file when we are in domain mode, i.e. this script creates the domain
// and we did not yet deployed the domain previously
if (!deployedDomain && props.parserMode === PARSER_MODES.MODE_DOMAIN) {
require('fs').appendFileSync(
path.join(
require("../../../infrastructure-scripts/dist/infra-comp-utils/system-libs").currentAbsolutePath(),
".env"),
`\nDOMAIN_${props.stage}=TRUE`
);
}
const newEntries = archive.findEntriesByMeta("url", /.+/).filter(entry => {
const entryURL = entry.getMeta("url");
const entryDomain = extractDomain(entryURL);
return (
entryDomain.length > 0 &&
(entryDomain === extractDomain(url) || entryDomain === url) &&
entry.isInTrash() === false
);
});
entries.push(
const newEntries = archive.findEntriesByMeta("url", /.+/).filter(entry => {
const entryURL = entry.getMeta("url");
const entryDomain = extractDomain(entryURL);
return entryDomain.length > 0 && entryDomain === extractDomain(url) && entry.isInTrash() === false;
});
entries.push(
{links.map(link => (
<li>
<title>{link.title}</title>
{extractDomain(link.link)}
{link.body}
</li>
))}
componentDidMount() {
const { entry } = this.props;
if (!entry) {
return;
}
const url = getEntryURL(entry);
const domain = url ? extractDomain(url) : null;
this.setState({
icon: getIconFilename(domain)
});
}
const newEntries = archive.findEntriesByMeta("url", /.+/).filter(entry => {
const entryURL = entry.getMeta("url");
const entryDomain = extractDomain(entryURL);
return entryDomain.length > 0 && entryDomain === extractDomain(url) && entry.isInTrash() === false;
});
entries.push(
const newEntries = archive.findEntriesByMeta("url", /.+/).filter(entry => {
const entryURL = entry.getMeta("url");
const entryDomain = extractDomain(entryURL);
return (
entryDomain.length > 0 &&
(entryDomain === extractDomain(url) || entryDomain === url) &&
entry.isInTrash() === false
);
});
entries.push(
export default ({title, description, url, cardSize, className}) => (
<content>
<title>
<CardText lines={1}>{title}</CardText>
</title>
{description}
{extractDomain(url)}
</content>
)
export function getIconForURL(url) {
const domain = extractDomain(url);
const filepath = getIconFilename(domain);
const filename = path.basename(filepath);
return getExtensionURL(`site-icons/images/${filename}`);
}