Skip to content

Commit

Permalink
chore: Update scripts
Browse files Browse the repository at this point in the history
Merge pull request #452 from DFE-Digital/update-scripts
  • Loading branch information
killij authored Mar 1, 2024
2 parents 40c9b83 + 14143f4 commit f8f4d95
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 146 deletions.
134 changes: 0 additions & 134 deletions Contentful-Schema/src/scripts/deleteOldContentModel.js

This file was deleted.

26 changes: 14 additions & 12 deletions Contentful-Schema/src/scripts/resyncEditorInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ console.log(boxen(chalk.whiteBright("Resynchronise an EditorInterface Controls w

const argv = await yargs(hideBin(process.argv))
.usage('Usage: $0 [options]')
.describe("t", "Contentful management API token")
.alias("t", "management-token")
.describe("s", "ID of the destination space ")
.alias("s", "space")
.describe("e", "ID the environment in the destination space")
.alias("e", "environment")
.describe("o", "Change the output format")
Expand All @@ -26,15 +22,21 @@ const argv = await yargs(hideBin(process.argv))
.default("o", "default")
.help(false)
.version(false)
.demandOption(["t", "s", "e"])
.argv;
.demandOption(["e"])
.argv

// const argv = {
// t: process.env.CONTENTFUL_MANAGEMENT_ACCESS_TOKEN,
// s: process.env.CPD_SPACE_ID,
// e: "dev",
// o: "default",
// }
argv.t = process.env.CONTENTFUL_MANAGEMENT_ACCESS_TOKEN
argv.s = process.env.CPD_SPACE_ID

if (!argv.t) {
console.error(`${chalk.redBright("Contentful management API token is required, please set the")} ${chalk.yellowBright.bold("CONTENTFUL_MANAGEMENT_ACCESS_TOKEN")} ${chalk.redBright("environment variable")}`)
process.exit(1)
}

if (!argv.s) {
console.error(`${chalk.redBright("Contentful space id is required, please set the")} ${chalk.yellowBright.bold("CPD_SPACE_ID")} ${chalk.redBright("environment variable")}`)
process.exit(1)
}

interface MainContext {
contentfulCtx: ContentfulContext
Expand Down

0 comments on commit f8f4d95

Please sign in to comment.