Skip to content

fix(manifest): Correct source of manifest#5575

Merged
niheaven merged 9 commits intoScoopInstaller:developfrom
HUMORCE:get-manifest-2
Feb 23, 2024
Merged

fix(manifest): Correct source of manifest#5575
niheaven merged 9 commits intoScoopInstaller:developfrom
HUMORCE:get-manifest-2

Conversation

@HUMORCE
Copy link
Copy Markdown
Member

@HUMORCE HUMORCE commented Jul 11, 2023

Description

Correct prompt about source of manifest when not found.

Motivation and Context

Close #5546

This is the original functionality that was broken when merging new features/refactoring. After the changes, user must explicitly input full filename for local manifests:

$manifest = '{
    "version": "1",
    "url": "http://example.org/#/App.exe"
}'

$manifest | out-file localmanifest.json -Encoding ascii
$manifest | out-file manifest_without_suffix -Encoding ascii

scoop install localmanifest × # This was allowed before.
scoop install localmanifest.json √
scoop install .\localmanifest.json √
scoop install manifest_without_suffix √

Example for actual usage:

~\Desktop\manifests
❯ ls -name
git
git.json
~\Desktop\manifests
❯ scoop info git

Name        : git
Description : Distributed version control system
Version     : 2.42.0.2
Bucket      : main
Website     : https://gitforwindows.org
License     : GPL-2.0-only
Updated at  : 8/30/2023 12:30:31 PM
Updated by  : github-actions[bot]
Installed   : 2.42.0.2
Binaries    : bin\sh.exe | bin\bash.exe | cmd\git.exe | cmd\gitk.exe | cmd\git-gui.exe | cmd\scalar.exe | usr\bin\tig.exe |
              git-bash.exe
Shortcuts   : Git Bash | Git GUI
Environment : GIT_INSTALL_ROOT = <root>
Notes       : Set Git Credential Manager Core by running: "git config --global credential.helper manager"

              To add context menu entries, run '<root>\install-context.reg'

              To create file-associations for .git* and .sh files, run '<root>\install-file-associations.reg'


~\Desktop\manifests

# install git from main bucket
❯ scoop install git

# install git from ~\Desktop\manifests\git file
❯ scoop install .\git

# install git from ~\Desktop\manifests\git.json file, unless a manifest with filename `git.json.json` in added buckets
❯ scoop install git.json

# install git from ~\Desktop\manifests\git.json file
❯ scoop install .\git.json

How Has This Been Tested?

test.ps1: https://gist.github.com/HUMORCE/4e215c95bdcbb9d17a6b0cda777b6331/raw/790ee7b5b050dfb511ce59e6c83efdd4404292f0/test.ps1

screenshot: left=before, right=after
Screenshot_230711021447

show source for remote or local manifest when installing:
Screenshot_231008140545

Checklist:

  • I have read the Contributing Guide.
  • I have ensured that I am targeting the develop branch.
  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.
  • I have added an entry in the CHANGELOG.

Comment thread lib/manifest.ps1
niheaven
niheaven previously approved these changes Oct 9, 2023
niheaven
niheaven previously approved these changes Oct 9, 2023
Comment thread lib/depends.ps1 Outdated
Co-authored-by: HUMORCE <humorce@outlook.com>
niheaven
niheaven previously approved these changes Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants