mirror of
https://github.com/goenning/google-indexing-script.git
synced 2024-11-28 23:14:01 +03:00
Change replace "/" with replaceAll "/"
This commit is contained in:
parent
46e67f7259
commit
170b034679
@ -51,8 +51,7 @@ export const index = async (
|
||||
const accessToken = await getAccessToken(options.client_email, options.private_key, options.path);
|
||||
let siteUrl = convertToSiteUrl(input);
|
||||
console.log(`🔎 Processing site: ${siteUrl}`);
|
||||
const cacheFileName = `${convertToFilePath(siteUrl)}`+".json";
|
||||
const cachePath = path.join(".cache", cacheFileName.replace("/", ""));
|
||||
const cachePath = path.join(".cache", `${convertToFilePath(siteUrl)}.json`);
|
||||
|
||||
if (!accessToken) {
|
||||
console.error("❌ Failed to get access token, check your service account credentials.");
|
||||
|
@ -20,7 +20,7 @@ export function convertToSiteUrl(input: string) {
|
||||
* @returns The converted file path
|
||||
*/
|
||||
export function convertToFilePath(path: string) {
|
||||
return path.replace("http://", "http_").replace("https://", "https_").replace("/", "_");
|
||||
return path.replace("http://", "http_").replace("https://", "https_").replaceAll("/", "_");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2,7 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"target": "esnext",
|
||||
"module": "commonjs",
|
||||
"lib": ["dom", "es6", "es2017", "esnext.asynciterable"],
|
||||
"lib": ["dom", "es6", "es2021", "esnext.asynciterable"],
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"outDir": "./dist",
|
||||
|
Loading…
Reference in New Issue
Block a user