Skip to content

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

Description

@mrymtsk

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.

Activity

  1. hupfdule commented on Apr 29, 2019

    @hupfdule
    Contributor

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

    Thanks for noting that!

  2. mrymtsk commented on Apr 29, 2019

    @mrymtsk
    ContributorAuthor

    Thanks!

    Sent with GitHawk

  3. reopened this on May 3, 2019
  4. tyru commented on May 3, 2019

    @tyru
    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions