-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: consistently use posix paths for links generated in docs markdown
fixes #259
- Loading branch information
1 parent
807e7ab
commit a617a47
Showing
8 changed files
with
47 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import { path } from "https://deno.land/x/[email protected]/deps.ts"; | ||
import { | ||
Dir, | ||
DirectoryGenerator, | ||
|
@@ -7,6 +6,8 @@ import { | |
import { Logger } from "../../cli/Logger.ts"; | ||
import { TerraformDocsCliFacade } from "../../api/terraform-docs/TerraformDocsCliFacade.ts"; | ||
import { indent } from "../../cli/indent.ts"; | ||
import { convertToPosixPath } from "../../path.ts"; | ||
import * as path from "std/path"; | ||
|
||
export async function newKitDirectoryCreation( | ||
modulePath: string, | ||
|
@@ -97,7 +98,7 @@ export async function generateTerragrunt( | |
const isBootstrap = kitModulePath.endsWith(`${path.SEP}bootstrap`); | ||
|
||
// terragrunt needs a posix style path | ||
const posixKitModulePath = kitModulePath.replaceAll("\\", "/"); | ||
const posixKitModulePath = convertToPosixPath(kitModulePath); | ||
|
||
const platformIncludeBlock = `include "platform" { | ||
path = find_in_parent_folders("platform.hcl") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as path from "std/path"; | ||
|
||
/** | ||
* Converts a relative path with windows or POSIX path separators to a relative path with POSIX separators | ||
* https://stackoverflow.com/questions/53799385/how-can-i-convert-a-windows-path-to-posix-path-using-node-path | ||
* @param relativePath a relative path (this is important!) | ||
* @returns | ||
*/ | ||
export function convertToPosixPath(relativePath: string) { | ||
return relativePath.split(path.sep).join(path.posix.sep); | ||
} |