Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"volt edit {repository}" drops {repository} #280

Closed
mrymtsk opened this issue Apr 27, 2019 · 3 comments
Closed

"volt edit {repository}" drops {repository} #280

mrymtsk opened this issue Apr 27, 2019 · 3 comments

Comments

@mrymtsk
Copy link
Contributor

mrymtsk commented Apr 27, 2019

Newly implemented subcommand "volt edit {repository}" (#278) seems to drop the {repository}.

$ volt get tyru/caw.vim
[INFO] Full building /Users/Toshiki/.vim/pack/volt/opt directory ...
[INFO] Installing vimrc and gvimrc ...
+ github.com/tyru/caw.vim > installed

$ cat ~/volt/lock.json
{
  "version": 2,
  "current_profile_name": "default",
  "repos": [
    {
      "type": "git",
      "path": "github.com/tyru/caw.vim",
      "version": "98805a60aef339e55e5b917fdb9f69c74e8d8340"
    }
  ],
  "profiles": [
    {
      "name": "default",
      "repos_path": [
        "github.com/tyru/caw.vim"
      ]
    }
  ]
}
$ volt edit tyru/caw.vim
# any edit

$ cat ~/volt/lock.json
{
  "version": 2,
  "current_profile_name": "default",
  "repos": [],
  "profiles": [
    {
      "name": "default",
      "repos_path": []
    }
  ]
}

volt/subcmd/edit.go

Lines 137 to 142 in b1c9efd

// Remove repository from lock.json
err = lockJSON.Repos.RemoveAllReposPath(reposPath)
err2 := lockJSON.Profiles.RemoveAllReposPath(reposPath)
if err == nil || err2 == nil {
// ignore?
}

Probably this block is related to this issue? If I remove this block and compile volt it works as expected.

@hupfdule
Copy link
Contributor

hupfdule commented Apr 29, 2019

Yes, you are right. That block shouldn't be there. I created a new PR to fix this.

Thanks for noting that!

@mrymtsk
Copy link
Contributor Author

mrymtsk commented Apr 29, 2019

Thanks!

Sent with GitHawk

@mrymtsk mrymtsk closed this as completed Apr 29, 2019
@tyru tyru reopened this May 3, 2019
@tyru
Copy link
Member

tyru commented May 3, 2019

Thanks for reporting!
I missed that code.
Re-opened this until the fix is merged.

@tyru tyru closed this as completed in 365a7c0 May 26, 2019
hupfdule added a commit to hupfdule/volt that referenced this issue Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants