Skip to content

Commit 679fc93

Browse files
committed
fix: format.nu path self
1 parent 4dac76d commit 679fc93

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

format.nu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env nu --stdin
22

3+
const script_path = path self .
4+
35
# Helper to run topiary with the correct environment variables for topiary-nushell
46
@example "Read from stdin" { bat foo.nu | format.nu }
57
@example "Format files (in-place replacement)" { format.nu foo.nu bar.nu }
@@ -8,7 +10,7 @@ def main [
810
--config_dir (-c): path # Root of the topiary-nushell repo, defaults to the parent directory of this script
911
...files: path # Files to format
1012
]: [nothing -> nothing string -> string] {
11-
let config_dir = $config_dir | default (pwd)
13+
let config_dir = $config_dir | default $script_path
1214
$env.TOPIARY_CONFIG_FILE = ($config_dir | path join languages.ncl)
1315
$env.TOPIARY_LANGUAGE_DIR = ($config_dir | path join languages)
1416

0 commit comments

Comments
 (0)