Skip to content

Update swift package archive-source command to provide directory prefix #3748

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

Merged
merged 1 commit into from
Sep 16, 2021

Conversation

mattt
Copy link
Contributor

@mattt mattt commented Sep 16, 2021

Updates swift package archive-source command according to the SE-0292 amendment.

Motivation:

With #3624, the behavior of the archive-source command now adds a --prefix argument to the git-archive invocation, so that entries are prefixed by output name.

Modifications:

  try callGit("archive",
              "--format", "zip",
+             "--prefix", path.basenameWithoutExt,
              "--output", path.pathString,
              "HEAD",
              failureMessage: "Couldn’t create an archive")

Result:

Generated source archives are prefixed by output name.

For example:

$ swift package archive-source --output="LinkedList-1.2.0.zip"
$ zipinfo LinkedList-1.2.0.zip
Archive:  path/to/LinkedList-1.2.0.zip
[...]
[...] LinkedList-1.2.0/
[...] LinkedList-1.2.0/Package.swift

@mattt
Copy link
Contributor Author

mattt commented Sep 16, 2021

@swift-ci Please smoke test

@tomerd tomerd merged commit 7197f40 into swiftlang:main Sep 16, 2021
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