doron-cohen / antidot

Cleans up your $HOME from those pesky dotfiles
MIT License
307 stars 18 forks source link

`antidot init` writes CRLF terminated script #246

Closed billy4479 closed 12 months ago

billy4479 commented 1 year ago

I've noticed problems with this podman because it will read the environment variables and create things like '~/.config''\r' and '~/.local/share''\r' which aren't recognized by other programs and very bad things happen.

Hexdump of antidot init ``` 00000000: 6578 706f 7274 2058 4447 5f43 4f4e 4649 export XDG_CONFI 00000010: 475f 484f 4d45 3d22 247b 5844 475f 434f G_HOME="${XDG_CO 00000020: 4e46 4947 5f48 4f4d 453a 2d2f 686f 6d65 NFIG_HOME:-/home 00000030: 2f62 696c 6c79 2f2e 636f 6e66 6967 7d22 /billy/.config}" 00000040: 0d0a 6578 706f 7274 2058 4447 5f43 4143 ..export XDG_CAC 00000050: 4845 5f48 4f4d 453d 2224 7b58 4447 5f43 HE_HOME="${XDG_C 00000060: 4143 4845 5f48 4f4d 453a 2d2f 686f 6d65 ACHE_HOME:-/home 00000070: 2f62 696c 6c79 2f2e 6361 6368 657d 220d /billy/.cache}". 00000080: 0a65 7870 6f72 7420 5844 475f 4441 5441 .export XDG_DATA 00000090: 5f48 4f4d 453d 2224 7b58 4447 5f44 4154 _HOME="${XDG_DAT 000000a0: 415f 484f 4d45 3a2d 2f68 6f6d 652f 6269 A_HOME:-/home/bi 000000b0: 6c6c 792f 2e6c 6f63 616c 2f73 6861 7265 lly/.local/share 000000c0: 7d22 0d0a 0d0a 6966 205b 202d 6620 222f }"....if [ -f "/ 000000d0: 686f 6d65 2f62 696c 6c79 2f2e 6c6f 6361 home/billy/.loca 000000e0: 6c2f 7368 6172 652f 616e 7469 646f 742f l/share/antidot/ 000000f0: 656e 762e 7368 2220 5d3b 2074 6865 6e20 env.sh" ]; then 00000100: 736f 7572 6365 2022 2f68 6f6d 652f 6269 source "/home/bi 00000110: 6c6c 792f 2e6c 6f63 616c 2f73 6861 7265 lly/.local/share 00000120: 2f61 6e74 6964 6f74 2f65 6e76 2e73 6822 /antidot/env.sh" 00000130: 3b20 6669 0d0a 6966 205b 202d 6620 222f ; fi..if [ -f "/ 00000140: 686f 6d65 2f62 696c 6c79 2f2e 6c6f 6361 home/billy/.loca 00000150: 6c2f 7368 6172 652f 616e 7469 646f 742f l/share/antidot/ 00000160: 616c 6961 732e 7368 2220 5d3b 2074 6865 alias.sh" ]; the 00000170: 6e20 736f 7572 6365 2022 2f68 6f6d 652f n source "/home/ 00000180: 6269 6c6c 792f 2e6c 6f63 616c 2f73 6861 billy/.local/sha 00000190: 7265 2f61 6e74 6964 6f74 2f61 6c69 6173 re/antidot/alias 000001a0: 2e73 6822 3b20 6669 0d0a .sh"; fi.. ``` It's easy to spot the `0d0a` all over the places.
billy4479 commented 12 months ago

I have no clue on how I manage to experience this issue the first time. Closing the issue since I cannot reproduce