Skip to content

Commit

Permalink
Remove realpath (idris-lang#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
ska80 authored May 25, 2021
1 parent 699de70 commit ad656a8
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The requirements are:

- A Scheme compiler; either Chez Scheme (default), or Racket.
- `bash`, with `realpath`. On Linux, you probably already have this.
On a Mac, you can install this with `brew install coreutils`.
On a macOS, you can install this with `brew install coreutils`.
On FreeBSD, OpenBSD and NetBSD, you can install `realpath` and `GNU make`
using a package manager. For instance, on OpenBSD you can install all of them
with `pkg_add coreutils gmake` command.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Idris 2
[![Documentation Status](https://readthedocs.org/projects/idris2/badge/?version=latest)](https://idris2.readthedocs.io/en/latest/?badge=latest)
[![Windows Status](https://github.com/idris-lang/Idris2/actions/workflows/ci-windows.yml/badge.svg)](https://github.com/idris-lang/Idris2/actions/workflows/ci-windows.yml)
[![Ubuntu Status](https://github.com/idris-lang/Idris2/actions/workflows/ci-ubuntu-combined.yml/badge.svg)](https://github.com/idris-lang/Idris2/actions/workflows/ci-ubuntu-combined.yml)
[![MacOS Status](https://github.com/idris-lang/Idris2/actions/workflows/ci-macos-combined.yml/badge.svg)](https://github.com/idris-lang/Idris2/actions/workflows/ci-macos-combined.yml)
[![macOS Status](https://github.com/idris-lang/Idris2/actions/workflows/ci-macos-combined.yml/badge.svg)](https://github.com/idris-lang/Idris2/actions/workflows/ci-macos-combined.yml)
[![Nix Status](https://github.com/idris-lang/Idris2/actions/workflows/ci-nix.yml/badge.svg)](https://github.com/idris-lang/Idris2/actions/workflows/ci-nix.yml)

[Idris 2](https://idris-lang.org/) is a purely functional programming language
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorial/starting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ which you can run:
$ ./build/exec/hello
Hello world

(On Macos you may first need to install realpath: ```brew install coreutils```)
(On macOS you may first need to install realpath: ```brew install coreutils```)

Please note that the dollar sign ``$`` indicates the shell prompt!
Some useful options to the Idris command are:
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Scheme/Chez.idr
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ startChezWinSh chez appdir target = unlines
, ""
, "set -e # exit on any error"
, ""
, "DIR=$(dirname \"$(realpath \"$0\")\")"
, "DIR=$(dirname \"$(readlink -f -- \"$0\")\")"
, "CHEZ=$(cygpath \"" ++ chez ++"\")"
, "export PATH=\"$DIR/" ++ appdir ++ "\":$PATH"
, "\"$CHEZ\" --script \"$DIR/" ++ target ++ "\" \"$@\""
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Scheme/ChezSep.idr
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ startChezWinSh chez appDirSh targetSh = unlines
, ""
, "set -e # exit on any error"
, ""
, "DIR=$(dirname \"$(realpath \"$0\")\")"
, "DIR=$(dirname \"$(readlink -f -- \"$0\")\")"
, "CHEZ=$(cygpath \"" ++ chez ++"\")"
, "export PATH=\"$DIR/" ++ appDirSh ++ "\":$PATH"
, "\"$CHEZ\" --program \"$DIR/" ++ targetSh ++ "\" \"$@\""
Expand Down
2 changes: 1 addition & 1 deletion src/Compiler/Scheme/Racket.idr
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ startRacketWinSh racket appdir target = unlines
, ""
, "set -e # exit on any error"
, ""
, "DIR=$(dirname \"$(realpath \"$0\")\")"
, "DIR=$(dirname \"$(readlink -f -- \"$0\")\")"
, "export PATH=\"$DIR/" ++ appdir ++ "\":$PATH"
, racket ++ "\"" ++ target ++ "\" \"$@\""
]
Expand Down
2 changes: 1 addition & 1 deletion support/refc/prim.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Value *sysOS(void)
#elif _WIN64
return (Value *)makeString("windows");
#elif __APPLE__ || __MACH__
return (Value *)makeString("Mac OSX");
return (Value *)makeString("macOS");
#elif __linux__
return (Value *)makeString("Linux");
#elif __FreeBSD__
Expand Down
6 changes: 5 additions & 1 deletion tests/chez/chez016/run
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# This test needs to run `idris2` from a sub-folder. Get the absolute path.

IDRIS2_EXEC="$(realpath "$1")"
if [ "$(uname)" = Darwin ]; then
IDRIS2_EXEC=$(zsh -c 'printf %s "$0:A"' "$1")
else
IDRIS2_EXEC="$(readlink -f -- "$1")"
fi

cd "folder with spaces" || exit

Expand Down

0 comments on commit ad656a8

Please sign in to comment.