casey / casey/just

[no-cd] attribute ignored by the absolute_path/canonicalize functions

Open
#2,822 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
35.8k
Forks
846
Avg merge
27m
Merged PRs (30d)
3

Description

Not sure if this is a bug, but the result surprised me:
With the just script (below, and) located in `~/bin/pathtest`, the `no-cd` attribute has no effect on the `absolute_path`/`canonicalize` functions.

``` just
#!/usr/bin/env -S just --justfile
# -*- just -*-

cd FILE="./":
@echo -e "\$HOME:\t\t$HOME"
@echo -e "\$PWD:\t\t$PWD"
@echo -e "pwd:\t\t$(pwd)"
@echo -e "absolute_path:\t{{ absolute_path(FILE)}}"
@echo -e "canonicalize:\t{{ canonicalize(FILE)}}"

[no-cd]
no-cd FILE="./":
@echo -e "\$HOME:\t\t$HOME"
@echo -e "\$PWD:\t\t$PWD"
@echo -e "pwd:\t\t$(pwd)"
@echo -e "absolute_path:\t{{ absolute_path(FILE)}}"
@echo -e "canonicalize:\t{{ canonicalize(FILE)}}"
```

## Output:

```
$ /usr/bin/env just --version
just 1.42.1

$ echo $HOME
/home/dwa

$ echo $PWD
/home/dwa

$ which pathtest
~/bin/pathtest

$ pathtest cd
$HOME: /home/dwa
$PWD: /home/dwa/bin
pwd: /home/dwa/bin
absolute_path: /home/dwa/bin
canonicalize: /home/dwa/bin

$ pathtest no-cd
$HOME: /home/dwa
$PWD: /home/dwa
pwd: /home/dwa
absolute_path: /home/dwa/bin
canonicalize: /home/dwa/bin
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.