Skip to content

Commit

Permalink
Fix paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
atykhonov committed Mar 15, 2017
1 parent 986dae2 commit 57dacfb
Show file tree
Hide file tree
Showing 17 changed files with 69 additions and 47 deletions.
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ cd Scale
./build/scale-bootstrap ./build/install.st
```

Then please add the Scale binaries to your `$PATH`:

```
export PATH="$HOME/.scale/scale:$PATH"
```
## Checking the installation
```bash
Expand Down Expand Up @@ -69,28 +75,28 @@ Scale installs itself in $HOME/.scale/ folder, adding the following files and di

```bash
$HOME/.scale/
├── pharo
├── pharo-ui
├── pharo-vm
│ ├── libB3DAcceleratorPlugin.so
│ ├── libFT2Plugin.so
│ ├── libgit2.so.0
│ ├── libInternetConfigPlugin.so
│ ├── libJPEGReaderPlugin.so
│ ├── libJPEGReadWriter2Plugin.so
│ ├── libRePlugin.so
│ ├── libSDL2-2.0.so.0
│ ├── libSDL2-2.0.so.0.2.1
│ ├── libSDL2DisplayPlugin.so
│ ├── libSqueakSSL.so
│ ├── libssh2.so.1
│ ├── libSurfacePlugin.so
│ ├── pharo
│ ├── PharoV50.sources
│ ├── vm-display-null
│ ├── vm-display-X11
│ ├── vm-sound-ALSA
│ └── vm-sound-null
├── pharo
├──pharo-ui
│ └─ pharo-vm
├── libB3DAcceleratorPlugin.so
├── libFT2Plugin.so
├── libgit2.so.0
├── libInternetConfigPlugin.so
├── libJPEGReaderPlugin.so
├── libJPEGReadWriter2Plugin.so
├── libRePlugin.so
├── libSDL2-2.0.so.0
├── libSDL2-2.0.so.0.2.1
├── libSDL2DisplayPlugin.so
├── libSqueakSSL.so
├── libssh2.so.1
├── libSurfacePlugin.so
├── pharo
├── PharoV50.sources
├── vm-display-null
├── vm-display-X11
├── vm-sound-ALSA
└── vm-sound-null
└── scale
├── scale
├── scale-ui
Expand All @@ -112,7 +118,7 @@ You can find a lot more examples in the examples directory.
#### Writing a program that interacts with stdin and stdout:

```smalltalk
#!/usr/local/bin/scale
#!/usr/bin/env scale
system stdout << 'I will echo everything you type. Type exit to exit';cr;cr.
Expand All @@ -126,7 +132,7 @@ got := system stdin upTo: Character lf.
#### Writing a program that calls ls -l

```smalltalk
#!/usr/local/bin/scale
#!/usr/bin/env scale
(system call: 'ls -l') lines do: [ :line |
system stdout << line.
Expand All @@ -137,7 +143,7 @@ got := system stdin upTo: Character lf.
#### Or doing the same directly in Pharo :D

```smalltalk
#!/usr/local/bin/scale
#!/usr/bin/env scale
system pwd entries do: [ :entry |
system stdout << entry asString.
Expand All @@ -148,7 +154,7 @@ system pwd entries do: [ :entry |
#### Asking for an asynchrouns call!

```smalltalk
#!/usr/local/bin/scale
#!/usr/bin/env scale
| futurels |
futurels := system callAsync: 'sleep 2 && ls -l'.
Expand All @@ -159,7 +165,7 @@ system pwd entries do: [ :entry |
#### Downloading new images, and using options :)

```smalltalk
#!/usr/local/bin/scale
#!/usr/bin/env scale
| version |
Expand Down
4 changes: 2 additions & 2 deletions build/install.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

| scaleParentDirectory pharoParentDirectory scaleFile scaleUIFile |

Expand Down Expand Up @@ -38,5 +38,5 @@ ifTrue: [
system call: 'chmod +x ', scaleFile fullName.
system call: 'chmod +x ', scaleUIFile fullName.
system stdout << 'Successfully installed Scale! Now, add the Scale binaries to your $PATH:'; cr.
system stdout << ('export PATH="{1}:$PATH"' format: { scaleParentDirectory | fullName }); cr.
system stdout << ('export PATH="{1}:$PATH"' format: { ('$HOME/', '.scale/', 'scale') }); cr.
].
10 changes: 5 additions & 5 deletions build/uninstall.st
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

| scapeParentDirectory scaleX scaleuiX |
| scaleParentDirectory |

system stdout << 'Uninstalling scale' << String cr.

system saveImageAs: #/ asFileReference / #tmp / #'uninstall.image'.
" The image must be stored elsewhere for deleting all the files "

scapeParentDirectory := (system home / '.scale') asFileReference.
scaleParentDirectory := (system home / '.scale') asFileReference.

scapeParentDirectory exists ifTrue: [ system call: ' rm -rf ', scapeParentDirectory fullName ].
system stdout << 'Removing scale folder' << String cr ; flush.
system stdout << 'Removing scale folder...' << String cr ; flush.
scaleParentDirectory exists ifTrue: [ system call: ' rm -rf ', scaleParentDirectory fullName ].

system stdout << 'Done!' << String cr.
2 changes: 1 addition & 1 deletion examples/callFailingScript.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

system stdout << 'Doing a wrong call'.
system stdout cr.
Expand Down
2 changes: 1 addition & 1 deletion examples/download.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale
| version |

version := (system arguments optionAt: #v ifAbsent: [ 50 ]) asInteger.
Expand Down
2 changes: 1 addition & 1 deletion examples/echoer.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

| got |

Expand Down
2 changes: 1 addition & 1 deletion examples/fact.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

| fact |

Expand Down
2 changes: 1 addition & 1 deletion examples/failurecode.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

system stdout << 'print to stdout';cr.

Expand Down
2 changes: 1 addition & 1 deletion examples/ls.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

(system call: 'ls -l') lines do: [ :line |
system stdout << line.
Expand Down
2 changes: 1 addition & 1 deletion examples/lsst.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

system pwd entries do: [ :entry |
system stdout << entry asString.
Expand Down
2 changes: 1 addition & 1 deletion examples/parallel-call.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale


| futurels |
Expand Down
2 changes: 1 addition & 1 deletion examples/parallel-call2.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale


| futurels |
Expand Down
2 changes: 1 addition & 1 deletion examples/parallel-error-call.st
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale


| futurels |
Expand Down
16 changes: 16 additions & 0 deletions examples/pwd.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env scale

| locator path |

path := (FileLocator home) path.

FileSystem disk changeDirectory: ((OSEnvironment current at: 'PWD') asFileReference).

"system stdout << (OSEnvironment current at: 'PWD'); cr."

system stdout << (system pwd fullName); cr.
system stdout << (FileSystem disk workingDirectory fullName); cr.
system stdout << ((system home / '.config') fullName); cr.


system stdout << (system class selectors joinUsing: '\r\n')
2 changes: 1 addition & 1 deletion examples/stdout.st
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/local/bin/scale
#!/usr/bin/env scale

system stdout << 'hello'
2 changes: 1 addition & 1 deletion scale-ui
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash


/usr/local/pharo/pharo-ui /usr/local/scale/Pharo.image scale "$@"
$HOME/.scale/pharo/pharo-ui $HOME/.scale/scale/Pharo.image scale "$@"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
as yet unclassified
interpreter
^ '#!/usr/local/bin/scale'
^ '#!/usr/bin/env scale'

0 comments on commit 57dacfb

Please sign in to comment.