mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 01:28:17 -07:00
Fix sed invocations for OSX
This commit is contained in:
parent
f23b448c0c
commit
5398d8949c
@ -51,7 +51,7 @@ write_shim_script() {
|
|||||||
cp "$plugin_shims_path/$executable_name" "$shim_path"
|
cp "$plugin_shims_path/$executable_name" "$shim_path"
|
||||||
elif [ -f "$shim_path" ]; then
|
elif [ -f "$shim_path" ]; then
|
||||||
if ! grep "# asdf-plugin-version: $version" "$shim_path" > /dev/null; then
|
if ! grep "# asdf-plugin-version: $version" "$shim_path" > /dev/null; then
|
||||||
sed "$shim_path" -i'' -e "s/\(asdf-plugin: $plugin_name\)/\1\n# asdf-plugin-version: $version/"
|
sed -i'' -e "s/\(asdf-plugin: $plugin_name\)/\1\\"$'\n'"# asdf-plugin-version: $version/" "$shim_path"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
cat <<EOF > "$shim_path"
|
cat <<EOF > "$shim_path"
|
||||||
@ -191,7 +191,7 @@ remove_shim_for_version() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed "$shim_path" -i'' -e "/# asdf-plugin-version: $version/d"
|
sed -i'' -e "/# asdf-plugin-version: $version/d" "$shim_path"
|
||||||
|
|
||||||
if [ ! -f "$plugin_shims_path/$executable_name" ] && \
|
if [ ! -f "$plugin_shims_path/$executable_name" ] && \
|
||||||
! grep "# asdf-plugin-version" "$shim_path" > /dev/null || \
|
! grep "# asdf-plugin-version" "$shim_path" > /dev/null || \
|
||||||
|
@ -69,7 +69,7 @@ teardown() {
|
|||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
lines_count=$(grep "asdf-plugin-version: 1.1" $ASDF_DIR/shims/dummy | wc -l)
|
lines_count=$(grep "asdf-plugin-version: 1.1" $ASDF_DIR/shims/dummy | wc -l)
|
||||||
[ "$lines_count" = "1" ]
|
[ "$lines_count" -eq "1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user