Skip to content

Commit 229b5b6

Browse files
committed
Allow dmg values to be extracted to custom locations
1 parent df4aca9 commit 229b5b6

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

common/private/convert_dmg.sh

+11-7
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818

1919
DMGFILE=$1
2020
OUTFILE=$2
21+
22+
echo $OUTFILE
23+
2124
mkdir -p tmp
22-
VOLUME=$(hdiutil attach "${DMGFILE}" | tail -1 | awk '{print $3}')
23-
cp -r "${VOLUME}/"*.app tmp
25+
VOLUME="$(hdiutil attach "${DMGFILE}" | tail -1 | awk -F'\t' '{print $NF}')"
26+
CWD="`pwd`"
27+
echo ${VOLUME}
28+
cd "${VOLUME}"
29+
zip -r /tmp/firefox.zip *.app
30+
cd "${CWD}"
2431
hdiutil detach "${VOLUME}" >/dev/null
25-
cd tmp
26-
zip -r "../${OUTFILE}" *
27-
cd ..
28-
rm -rf tmp
29-
rm "${DMGFILE}"
32+
#rm "${DMGFILE}"
33+
mv /tmp/firefox.zip "$OUTFILE"

common/private/dmg_archive.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _dmg_archive_impl(repository_ctx):
2424
repository_ctx.extract(
2525
archive = zip_name,
2626
stripPrefix = repository_ctx.attr.strip_prefix,
27+
output = repository_ctx.attr.output,
2728
)
2829

2930
repository_ctx.file(
@@ -39,6 +40,7 @@ dmg_archive = repository_rule(
3940
),
4041
"sha256": attr.string(),
4142
"strip_prefix": attr.string(),
43+
"output": attr.string(),
4244
"build_file_content": attr.string(),
4345
"build_file": attr.label(),
4446
},

0 commit comments

Comments
 (0)