diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..07a2ece2 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,24 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node +{ + "name": "Node.js & TypeScript", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", + // Configure tool-specific properties. + "customizations": { + "vscode": { + "extensions": [ + "github.vscode-pull-request-github", + "github.copilot" + ] + } + }, + // Commands to be run after the container is created. + "postCreateCommand": [ + "echo 'Add PWSH'", + "wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb", + "sudo dpkg -i packages-microsoft-prod.deb", + "sudo apt-get update", + "sudo apt-get install -y powershell" + ] +} \ No newline at end of file diff --git a/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiFuntions.ts b/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiFuntions.ts index 6005223f..139ba11f 100644 --- a/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiFuntions.ts +++ b/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiFuntions.ts @@ -125,6 +125,12 @@ export async function UpdateGitWikiFile( mode) { const git = simpleGit(); + // show error if content is null + if (!contents) { + logError(`The new content is null, so cannot be used to update the wiki`); + return; + } + let remote = ""; let logremote = ""; // used to make sure we hide the password in logs var extraHeaders = []; // Add handling for #613 diff --git a/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiTask.ts b/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiTask.ts index 4b83a0c8..694677cf 100644 --- a/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiTask.ts +++ b/Extensions/WikiUpdater/WikiUpdaterTask/src/GitWikiTask.ts @@ -95,6 +95,7 @@ var haveData = true; var contents; // we late declare as it might be buffer or string if (dataIsFile === true) { if (fs.existsSync(sourceFile)) { + logInfo(`Reading file ${sourceFile}`); if (fixLineFeeds) { contents = fs.readFileSync(sourceFile, "utf8"); } else { @@ -106,6 +107,7 @@ if (dataIsFile === true) { } } else { // we do this late copy so that we can use the same property for different encodings with a type clash + logInfo(`Using contents string directly input`); contents = contentsInput; }