Skip to content

Commit 92e609e

Browse files
committed
workaround for executable permission
1 parent cfb9c04 commit 92e609e

File tree

10 files changed

+140
-5
lines changed

10 files changed

+140
-5
lines changed

packages/@rescript/darwin-arm64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"bin/"
2626
],
2727
"exports": "./bin.js",
28-
"preferUnplugged": true
28+
"preferUnplugged": true,
29+
"scripts": {
30+
"postpack": "./scripts/repack.sh package.tgz"
31+
}
2932
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Yarn doens't preserve executable permission bits of files as design decision.
4+
#
5+
# Workaround:
6+
7+
set -e
8+
9+
PACKAGE_TGZ="$1"
10+
11+
if [[ -z "$PACKAGE_TGZ" ]]; then
12+
echo "Usage: $0 path/to/package.tgz"
13+
exit 1
14+
fi
15+
16+
TMP_DIR="$(mktemp -d)"
17+
18+
tar -xzf "$PACKAGE_TGZ" -C "$TMP_DIR"
19+
20+
chmod +x "$TMP_DIR/package/bin/"*
21+
22+
tar -czf "$PACKAGE_TGZ" -C "$TMP_DIR" package
23+
24+
echo "Repacked successfully"

packages/@rescript/darwin-x64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"bin/"
2626
],
2727
"exports": "./bin.js",
28-
"preferUnplugged": true
28+
"preferUnplugged": true,
29+
"scripts": {
30+
"postpack": "./scripts/repack.sh package.tgz"
31+
}
2932
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Yarn doens't preserve executable permission bits of files as design decision.
4+
#
5+
# Workaround:
6+
7+
set -e
8+
9+
PACKAGE_TGZ="$1"
10+
11+
if [[ -z "$PACKAGE_TGZ" ]]; then
12+
echo "Usage: $0 path/to/package.tgz"
13+
exit 1
14+
fi
15+
16+
TMP_DIR="$(mktemp -d)"
17+
18+
tar -xzf "$PACKAGE_TGZ" -C "$TMP_DIR"
19+
20+
chmod +x "$TMP_DIR/package/bin/"*
21+
22+
tar -czf "$PACKAGE_TGZ" -C "$TMP_DIR" package
23+
24+
echo "Repacked successfully"

packages/@rescript/linux-arm64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"bin/"
2626
],
2727
"exports": "./bin.js",
28-
"preferUnplugged": true
28+
"preferUnplugged": true,
29+
"scripts": {
30+
"postpack": "./scripts/repack.sh package.tgz"
31+
}
2932
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Yarn doens't preserve executable permission bits of files as design decision.
4+
#
5+
# Workaround:
6+
7+
set -e
8+
9+
PACKAGE_TGZ="$1"
10+
11+
if [[ -z "$PACKAGE_TGZ" ]]; then
12+
echo "Usage: $0 path/to/package.tgz"
13+
exit 1
14+
fi
15+
16+
TMP_DIR="$(mktemp -d)"
17+
18+
tar -xzf "$PACKAGE_TGZ" -C "$TMP_DIR"
19+
20+
chmod +x "$TMP_DIR/package/bin/"*
21+
22+
tar -czf "$PACKAGE_TGZ" -C "$TMP_DIR" package
23+
24+
echo "Repacked successfully"

packages/@rescript/linux-x64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"bin/"
2626
],
2727
"exports": "./bin.js",
28-
"preferUnplugged": true
28+
"preferUnplugged": true,
29+
"scripts": {
30+
"postpack": "./scripts/repack.sh package.tgz"
31+
}
2932
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Yarn doens't preserve executable permission bits of files as design decision.
4+
#
5+
# Workaround:
6+
7+
set -e
8+
9+
PACKAGE_TGZ="$1"
10+
11+
if [[ -z "$PACKAGE_TGZ" ]]; then
12+
echo "Usage: $0 path/to/package.tgz"
13+
exit 1
14+
fi
15+
16+
TMP_DIR="$(mktemp -d)"
17+
18+
tar -xzf "$PACKAGE_TGZ" -C "$TMP_DIR"
19+
20+
chmod +x "$TMP_DIR/package/bin/"*
21+
22+
tar -czf "$PACKAGE_TGZ" -C "$TMP_DIR" package
23+
24+
echo "Repacked successfully"

packages/@rescript/win32-x64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
"bin/"
2626
],
2727
"exports": "./bin.js",
28-
"preferUnplugged": true
28+
"preferUnplugged": true,
29+
"scripts": {
30+
"postpack": "./scripts/repack.sh package.tgz"
31+
}
2932
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Yarn doens't preserve executable permission bits of files as design decision.
4+
#
5+
# Workaround:
6+
7+
set -e
8+
9+
PACKAGE_TGZ="$1"
10+
11+
if [[ -z "$PACKAGE_TGZ" ]]; then
12+
echo "Usage: $0 path/to/package.tgz"
13+
exit 1
14+
fi
15+
16+
TMP_DIR="$(mktemp -d)"
17+
18+
tar -xzf "$PACKAGE_TGZ" -C "$TMP_DIR"
19+
20+
chmod +x "$TMP_DIR/package/bin/"*
21+
22+
tar -czf "$PACKAGE_TGZ" -C "$TMP_DIR" package
23+
24+
echo "Repacked successfully"

0 commit comments

Comments
 (0)