Skip to content

zip is zipping up the source folder instead of its content #349

@joan38

Description

@joan38

Happens only in 0.11.4-M3 and 0.11.4-M4.
0.11.3 or 0.11.4-M2 work, so it's in between M2 and M3.

Reproduce

mkdir os-lib-issue-x && cd $_

curl -o scala https://raw.githubusercontent.com/VirtusLab/scala-cli/main/scala-cli.sh && chmod +x scala

mkdir sources
echo "toto1" > sources/file1.txt
echo "toto2" > sources/file2.txt

cat > run.scala <<EOF
//> using scala 3.6.3
//> using dep com.lihaoyi::os-lib:0.11.4-M4

@main def run() =
  val sources = os.pwd / "sources"
  val myZip = os.pwd / "my.zip"
  os.remove(myZip)
  os.zip(myZip, Seq(sources))

  val content = os.unzip.list(myZip).toSet
  val expected = os.list(sources).map(_.relativeTo(sources)).toSet
  assert(content == expected, s"\$content != \$expected")
EOF

./scala .

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions