Skip to content

dotman seems unable to execute the add_env function properlyΒ #25

@dulhaver

Description

@dulhaver

Describe the bug
running dotman the second time I end up in the initial setup again.

  • I found out that apparently the add_env function is not being executed as it should.
  • I guess the variables DOT_REPO and DOT_DEST are somehow known via some declaration within the script and therefore the check [[ "$DOT_DEST" && "$DOT_REPO" ]] && return in line 89 never fails and likewise the rest of the function (with adding those to ~/.bashrc never runs. I could not solve this though

expected behavior
dotman would recognize that it ran alreay and therefore throw me into the regular interface, not the initial setup again and again

To Reproduce
Steps to reproduce the behavior:

  1. sh -c "$(curl -fsSL https://raw.githubusercontent.com/Bhupesh-v/dotman/master/tools/install.sh)"
  2. cd ~/dotman && mkdir ~/.dotfiles && ./dotman.sh
  3. source ~/.bashrc
  4. ./dotman.sh

Expected behavior
A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • manjaro,bash: 5.2.15(1)-release
  • ubuntu 22.04, bash: 5.1.16(1)-release

Additional context
I tested this on my local manjaro. As I failed constantly with trying many things to troubleshout and also because am running oh-my-bash there i did another test inside a fresh ubuntutu 22.04 lxc container. Here is what I got there (same behavior).

07:28:22 manolo@manj-laptop dotman Β±|dulhaver_bugfixing βœ—|β†’ lxc exec ubn2204-dotman -- sh -c "$(curl -fsSL https://raw.githubusercontent.com/Bhupesh-v/dotman/master/tools/install.sh)"
Cloning into 'dotman'...
remote: Enumerating objects: 347, done.
remote: Counting objects: 100% (125/125), done.
remote: Compressing objects: 100% (45/45), done.
remote: Total 347 (delta 70), reused 117 (delta 66), pack-reused 222
Receiving objects: 100% (347/347), 142.44 KiB | 1.56 MiB/s, done.
Resolving deltas: 100% (196/196), done.
[βœ”οΈ ] Successfully cloned dβ—‹tman
fatal: '5e0613c3ed47948f63f60461abfc05744237e8b3	refs/tags/v0.3.0' is not a commit and a branch 'master' cannot be created from it
Couldn't set alias for dotman: /root/dotman/dotman.sh
Consider adding it manually.
07:28:58 manolo@manj-laptop dotman Β±|dulhaver_bugfixing βœ—|β†’ lxc exec ubn2204-dotman -- bash
root@ubn2204-dotman:~# cd dotman
root@ubn2204-dotman:~/dotman# ls
CHANGELOG.md  CODE_OF_CONDUCT.md  CONTRIBUTING.md  LICENSE  README.md  assets  dotman.sh  tools
root@ubn2204-dotman:~/dotman# mkdir ~/.dotfiles && ./dotman.sh

Hi  πŸ‘‹
      _       _                         
     | |     | |                        
   __| | ___ | |_ _ __ ___   __ _ _ __  
  / _` |/ _ \| __| `_ ' _ \ / _' | '_ \ 
 | (_| | (_) | |_| | | | | | (_| | | | |
  \__,_|\___/ \__|_| |_| |_|\__,_|_| |_|



First time use πŸ”₯, Set Up dotman
....................................
➀ Enter dotfiles repository URL : https://gitlab.com/dulhaver_devops/dotfiles.git
➀ Where should I clone dotfiles.git (/root/..): .dotfiles

Calling πŸ“ž Git ... 
Cloning into 'dotfiles'...
Username for 'https://gitlab.com': dulhaver
Password for 'https://dulhaver@gitlab.com': 
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7 (delta 2), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (7/7), done.
Resolving deltas: 100% (2/2), done.

[βœ”οΈ ] dotman successfully configured
Open a new terminal or source your shell config

Thanks for using dotman πŸ––.

root@ubn2204-dotman:~/dotman# source ~/.bashrc
root@ubn2204-dotman:~/dotman# ./dotman.sh

Hi  πŸ‘‹
      _       _                         
     | |     | |                        
   __| | ___ | |_ _ __ ___   __ _ _ __  
  / _` |/ _ \| __| `_ ' _ \ / _' | '_ \ 
 | (_| | (_) | |_| | | | | | (_| | | | |
  \__,_|\___/ \__|_| |_| |_|\__,_|_| |_|

First time use πŸ”₯, Set Up dotman
....................................
➀ Enter dotfiles repository URL : 

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions