Skip to content

Commit

Permalink
fix typo in check
Browse files Browse the repository at this point in the history
  • Loading branch information
msteen committed Feb 11, 2023
1 parent cb48580 commit 43ca5e6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkgs/auto-fix-vscode-server.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,14 @@ in writeShellScript "auto-fix-vscode-server.sh" ''
local bin_dir=$1 interp
ln -sfT ${nodejsWrapped}/bin/node "$bin_dir/node"
while read -rd ''' bin; do
interp=$(patchelf --print-interpreter "$bin" 2>/dev/null) && [[ $interp != "$node_rpath" ]] || continue
# Check if binary is patchable, e.g. not a statically-linked or non-ELF binary.
if ! interp=$(patchelf --print-interpreter "$bin" 2>/dev/null); then
continue
fi
# Check if it is not already patched for Nix.
if [[ $interp == "$node_interp" ]]; then
continue
fi
patchelf --set-interpreter "$node_interp" --set-rpath "$node_rpath" "$bin"
patchelf --shrink-rpath "$bin"
done < <(find "$bin_dir" -type f -perm -100 -printf '%p\0')
Expand Down

0 comments on commit 43ca5e6

Please sign in to comment.