Skip to content

Commit

Permalink
Add script to create a vendored tarball
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Mar 24, 2020
1 parent f6e51b6 commit 481315b
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions create-vendored-tar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

WORKDIR=./vendored-tar
TARFILE=archived-tar.tar.gz

rm -rf ${WORKDIR}
mkdir ${WORKDIR}

# Copy all relevant files
cp -r ./src/ ./Cargo.toml ./Cargo.lock ./LICENSE ./README.md ${WORKDIR}
cd ${WORKDIR}

cargo vendor --locked ./vendor

mkdir ./.cargo
cat <<EOF > ./.cargo/config
[source.crates-io]
replace-with = "vendored-sources"
[source.vendored-sources]
directory = "vendor"
EOF

tar -czf ${TARFILE} ./*

cd ..
mv ${WORKDIR}/${TARFILE} .
rm -rf ${WORKDIR}

0 comments on commit 481315b

Please sign in to comment.