Open kovalchik opened 1 year ago
I've not been able to recreate this problem. I specifically was using version 3.2.1 and Git version 2.38.0, but on Linux. It might be some issue with the version of awk being use (based on output you mentioned)? Can let me know the output of awk --version
, and if possible, could you try again using gawk/awk brew installed?
Can you doublecheck your instructions to reproduce? For example, where you write rm example
, I think you probably meant rm example.txt
.
Can you also show me the output of:
yadm alt
and the output of:
yadm config --get-all local.class
Installing awk through Homebrew did not resolve the issue. However, installing gawk via Homebrew did fix the issue! 🙌
Here's the outputs you asked for, in case you're still interested in trying to replicate this.
MacOS 12.6 awk version: 20200816
Homebrew awk version: 20211208
GNU Awk (gawk) version: 5.2.0
This is the output of yadm alt
using the MacOS built in awk (class names have been changed to classone
and classtwo
for clarity):
Linking /Users/darrenk/.config/fish/functions/project_specific_functions.fish##class.classtwo to /Users/darrenk/.config/fish/functions/project_specific_functions.fish
Linking /Users/darrenk/.config/git/config.local##class.classone to /Users/darrenk/.config/git/config.local
Linking /Users/darrenk/.config/git/config.classtwo##class.classtwo to /Users/darrenk/.config/git/config.classtwo
Creating /Users/darrenk/Brewfile from template /Users/darrenk/Brewfile##template
awk: newline in string classone
classtwo... at source line 1
This is the output of yadm config --get-all local.class
using the MacOS build in awk:
classone
classtwo
awk: newline in string classone
classtwo... at source line 1
Should https://github.com/TheLocehiliosan/yadm/blob/abf6ea4b610f50f6bf6ff51fc351ffb6bd7c70e1/yadm#L1780-L1785 read:
function set_awk() {
local pgm
for pgm in "${AWK_PROGRAM[@]}"; do
command -v "$pgm" &> /dev/null && AWK_PROGRAM=("$pgm") && return
[[ "$OSTYPE" =~ ^[Dd]arwin ]] && return # only gawk works on MacOS
done
}
?
Should
I'm not sure. Perhaps the internal template processor can be made compatible with the MacOS awk.
Describe the bug
If multiple local classes are specified, templates do not seem to process or produce a file.
To reproduce
Can this be reproduced with the yadm/testbed docker image: Unknown
Steps to reproduce the behavior:
yadm init
yadm config local.class someclass
echo "This is a sample text" > example.txt##template
yadm add example.txt##template
yadm status
ls
rm example
yadm config --add local.class someotherclass
yadm status
ls
Expected behavior
The file
example.txt
should be created each timeyadm status
is run. However, theexample.txt
file is not created after adding the second class. The following output is seen after yadm commands, if there are two local classes:Environment
Additional context
I was unable to reproduce this with the yadm docker image. I was unable to product any files via alternative or template files with the docker image. I assume that problem is either user error or unrelated to this issue.