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

Improvements for the reset command to deal with empty current alias dir correctly #2896

Merged
merged 8 commits into from
Dec 16, 2018
Merged

Conversation

Retia-Adolf
Copy link
Contributor

@Retia-Adolf Retia-Adolf commented Dec 14, 2018

#2772

I think I finally made out this crap...

@r15ch13 r15ch13 added enhancement review-needed Asks for review of these changes work-in-progress labels Dec 14, 2018
@Ash258
Copy link
Contributor

Ash258 commented Dec 14, 2018

What's wrong with reset command, that you need this one?

@r15ch13
Copy link
Member

r15ch13 commented Dec 14, 2018

I would also suggest adding this feature to the reset command.
Get the last version directory (simply order by modified date) and recreate the current directory link.

@Retia-Adolf
Copy link
Contributor Author

Retia-Adolf commented Dec 14, 2018

@Ash258 well, didn't notice that

ok, it seems lacking of steps of re-linking persist files/dirs; sorry, im wrong.. and another problem is:

$version = current_version $app $global

in the reset command uses function current_version in lib\versions.ps1, sorts $appdir's version dirs by name. So I should modify it to exclude empty dirs? or... er, as what @r15ch13 suggest? (but why current dir would be modified earlier than others, I see what has been reset its current is re-linked)

scoop list
Installed apps:

  7zip 18.05
  adopt11-hotspot current
  atom current
  bulk-crap-uninstaller current
  cmder current
  concfg current
  cpu-z current
  docker current
  ffmpeg current
  git 2.18.0.windows.1
  gpg4win current
  innounp current
  ipfilter-updater current
  nginx current
  notepadplusplus current
  notepadplusplus-pm current
  nvm current
  peerblock current
  persepolis current
  pester current
  psiphon3 current
  qbittorrent current
  recuva current
  shadowsocks current
  shadowsocksr-csharp current
  tor-browser current
  vagrant current
  win-portacle current
  xdman current
  xx-net current
  zeronet current

PS > scoop reset
ERROR <app> missing
Usage: scoop reset <app>
PS > scoop reset *
Resetting 7zip (18.05).
Linking ~\scoop\apps\7zip\current => ~\scoop\apps\7zip\18.05
Creating shim for '7z'.
Creating shortcut for 7-Zip (7zFM.exe)
ERROR 'adopt11-hotspot (current)' isn't installed
ERROR 'atom (current)' isn't installed
ERROR 'bulk-crap-uninstaller (current)' isn't installed
ERROR 'cmder (current)' isn't installed
ERROR 'concfg (current)' isn't installed
ERROR 'cpu-z (current)' isn't installed
ERROR 'docker (current)' isn't installed
ERROR 'ffmpeg (current)' isn't installed
Resetting git (2.18.0.windows.1).
Linking ~\scoop\apps\git\current => ~\scoop\apps\git\2.18.0.windows.1
Creating shim for 'git'.
Creating shim for 'gitk'.
Creating shim for 'git-gui'.
Creating shim for 'tig'.
Creating shim for 'git-bash'.
Creating shortcut for Git Bash (git-bash.exe)
ERROR 'gpg4win (current)' isn't installed
ERROR 'innounp (current)' isn't installed
ERROR 'ipfilter-updater (current)' isn't installed
ERROR 'nginx (current)' isn't installed
ERROR 'notepadplusplus (current)' isn't installed
ERROR 'notepadplusplus-pm (current)' isn't installed
ERROR 'nvm (current)' isn't installed
ERROR 'peerblock (current)' isn't installed
ERROR 'persepolis (current)' isn't installed
ERROR 'pester (current)' isn't installed
ERROR 'psiphon3 (current)' isn't installed
ERROR 'qbittorrent (current)' isn't installed
ERROR 'recuva (current)' isn't installed
ERROR 'shadowsocks (current)' isn't installed
ERROR 'shadowsocksr-csharp (current)' isn't installed
ERROR 'tor-browser (current)' isn't installed
ERROR 'vagrant (current)' isn't installed
ERROR 'win-portacle (current)' isn't installed
ERROR 'xdman (current)' isn't installed
ERROR 'xx-net (current)' isn't installed
ERROR 'zeronet (current)' isn't installed

@r15ch13
Copy link
Member

r15ch13 commented Dec 14, 2018

Ah, ignore my comment. Didn't think this through.
current_version returns the correct version. No need to order the version directories. 😄

@Retia-Adolf Retia-Adolf changed the title Add libexec\scoop-fix.ps1 Improvements for the reset command to deal with empty current alias dir correctly Dec 15, 2018
Copy link
Member

@rasa rasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter is failing as null should be on the left side

@rasa rasa merged commit 3d8d5e8 into ScoopInstaller:master Dec 16, 2018
@rasa rasa removed review-needed Asks for review of these changes work-in-progress labels Dec 16, 2018
@Retia-Adolf Retia-Adolf deleted the patch-3 branch December 16, 2018 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants