diff --git a/.gitignore b/.gitignore index ca05d91..baf9a90 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ cache/ *~ +/cache/* diff --git a/README.md b/README.md index 850eea7..8720ea9 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,45 @@ [![Build Status](https://travis-ci.org/guillep/Scale.svg?branch=master)](https://travis-ci.org/guillep/Scale) - -Scale -===== +# Scale Scale aims to take Pharo into the shell. That is, to write shell scripts in Pharo, use its power, and have a better syntax instead of the ugly bash one :). -DISCLAIMER: Scale is tested only in Linux. - - -Installing ----------- - -For installing Scale you have to be SUDOER and to have internet connection. +DISCLAIMER: Scale is tested only in Linux. +# Installing +For installing Scale you have to be SUDOER and to have internet connection. # Development vs Usage - We have two flavors for installing Scale. ZeroConf, and Classic. - If you want to see what is happening during the installation, or if you want to do your own modifications, you want to follow the classic guide. - If you just want to use it, ZeroConf is your deal. - +We have two flavors for installing Scale. ZeroConf, and Classic. +If you want to see what is happening during the installation, or if you want to do your own modifications, you want to follow the classic guide. +If you just want to use it, ZeroConf is your deal. ## ZeroConf Because nobody likes to do it in more than one line: + ```bash -wget -O- https://raw.githubusercontent.com/guillep/Scale/master/setupScale.sh | sudo bash +wget -O- https://raw.githubusercontent.com/guillep/Scale/master/setupScale.sh | bash ``` - -## Classic installation +## The Classic installation ```bash git clone https://github.com/guillep/Scale cd Scale ./build/build.sh -sudo ./build/scale-bootstrap ./build/install.st +./build/scale-bootstrap ./build/install.st ``` +Then please add the Scale binaries to your `$PATH`: -## Checking the installation +``` +export PATH="$HOME/.scale/scale:$PATH" +``` + +## Checking the installation ```bash $> scale --version @@ -71,68 +69,56 @@ scale-ui [ script-path [ script-options] | folder ] $>scale-ui /path/to/my-script/folder ``` - - ## Installation folders -Scale installs itself in `/usr/local/bin` folder, adding the following files and directories: +Scale installs itself in $HOME/.scale/ folder, adding the following files and directories: ```bash -/usr/local -├── bin -│   └── scale -│   └── scale-ui -├── pharo -│   └── 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 +$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 └── scale - ├── uninstall.st - ├── scale - ├── scale-ui - ├── Pharo.image - └── Pharo.changes - + ├── scale + ├── scale-ui + ├── Pharo.image + ├── Pharo.changes + └── uninstall.st ``` -Since the installation process is supposed to address `/usr/local/bin` as installation folder, there is no need for adding any information to the `PATH` variable. - +## Uninstall Scale -## Uninstall Scale ```bash -sudo /usr/local/scale/uninstall.st +$HOME/.scale/scale/uninstall.st ``` - - - -Examples -------- +# Examples 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. @@ -146,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. @@ -157,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. @@ -165,43 +151,37 @@ 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'. futurels onSuccessDo: [ :ls | system stdout << ls ]. system stdout << 'just after the future call';cr. - ``` - - -#### Downloading new images, and using options :) +#### Downloading new images, and using options :) ```smalltalk -#!/usr/local/bin/scale +#!/usr/bin/env scale | version | version := (system arguments optionAt: #v ifAbsent: [ 50 ]) asInteger. system stdout << 'Downloading ' << version asString << ' into: ' << system pwd fullName; flush. system loadPharo: version into: system pwd. - ``` +# The System variable -The System variable -------------------- The system variable, that is available in any scale script, is an Instance of SCSystemFacade -Here a directory for watching the available methods: - +Here a directory for watching the available methods: ## Util-Streams + ```smalltalk system stdout " It returns the instance of the stdout stream" system stderr " It returns the instance of the stderr stream" @@ -209,105 +189,117 @@ system stdin " It returns the instance of the stdin stream" ``` ## Util-Bash + ```smalltalk system chmod: aPermissionString to: aFileReferenceOrStringPattern "Chmod command for basic usage." system ln: aTargetReference to: aLinkReference "ln command for symlink usage." -system untargz: aFileReference to: aDestinationReference "Typical command for decompressing -a regular tar+gunzip file" -system untargz: aFileReference "Typical command for decompressing a regular tar+gunzip +system untargz: aFileReference to: aDestinationReference "Typical command for decompressing +a regular tar+gunzip file" +system untargz: aFileReference "Typical command for decompressing a regular tar+gunzip file on a temp directory" -system unzip: aFileReference to: aDestinationReference "Typical command for decompressing a +system unzip: aFileReference to: aDestinationReference "Typical command for decompressing a regular zip file" -system unzip: aFileReference "Typical command for decompressing a regular tar+gunzip file on +system unzip: aFileReference "Typical command for decompressing a regular tar+gunzip file on a temp directory on a temp directory" -system wget: anUrl to: outFileReference "fetch a file from an url by using wget. and saving +system wget: anUrl to: outFileReference "fetch a file from an url by using wget. and saving it in a given destination" -system wget: anUrl "fetch a file from an url by using wget. and saving it in a temporal +system wget: anUrl "fetch a file from an url by using wget. and saving it in a temporal destination" -system wget: anURL andUntargz: aDestination "fetch a file from an url by using wget.And saving +system wget: anURL andUntargz: aDestination "fetch a file from an url by using wget.And saving it in a temporal destination and it tries to decompress it from a tar-gz format" -system wget: anURL andUnzip: aDestination " fetch a file from an url by using wget. And saving +system wget: anURL andUnzip: aDestination " fetch a file from an url by using wget. And saving it in a temporal destination and it tries to decompress it from a zip format" ``` + ## Util-Execute third pharo + ```smalltalk -system execute: aString into: anImageBundle "Executes a given string content into an given +system execute: aString into: anImageBundle "Executes a given string content into an given image." -system execute: aString into: anImageBundle andSaveItAt: aDestination "Executes a given +system execute: aString into: anImageBundle andSaveItAt: aDestination "Executes a given string content into an given image. then saves this image in the given destination" ``` + ## Util-Load pharo + ```smalltalk -system loadPharo: aVersion into: aFileReference " Downloads a pharo image+bundle of the given +system loadPharo: aVersion into: aFileReference " Downloads a pharo image+bundle of the given version into a given destination. It returns an image bundle object" -system loadBaseline: aPackageName from: aRepository into: anImageBundle andSaveItAt: aDirectory -" It loads the pointed baseline from the pointed repository and saves the image into +system loadBaseline: aPackageName from: aRepository into: anImageBundle andSaveItAt: aDirectory +" It loads the pointed baseline from the pointed repository and saves the image into the given destination. It returns an image bundle object " -system loadUIBaseline: aPackageName from: aRepository into: anImageBundle andSaveItAt: aDirectory -" It loads the pointed baseline from the pointed repository in GRAPHICAL mode, +system loadUIBaseline: aPackageName from: aRepository into: anImageBundle andSaveItAt: aDirectory +" It loads the pointed baseline from the pointed repository in GRAPHICAL mode, then it saves the image into the given destination. It returns an image bundle object " ``` -## Util-Call commands + +## Util-Call commands + ```smalltalk -system bash: aString " It executes synchronously a given string in a fresh bash instance " -system call: aString " It executes synchronously a given string in a fresh default-interpreter -instance " -system callAsync: aString " It executes Asynchronously a given string in a fresh -default-interpreter instance " -system scale: aScript " It executes synchronously a given scale script FILE in a fresh -scale instance " +system bash: aString " It executes synchronously a given string in a fresh bash instance " +system call: aString " It executes synchronously a given string in a fresh default-interpreter +instance " +system callAsync: aString " It executes Asynchronously a given string in a fresh +default-interpreter instance " +system scale: aScript " It executes synchronously a given scale script FILE in a fresh +scale instance " ``` + ## Util-Environment + ```smalltalk -system environment: aString "It returns the value of the given environment variable name" -system home " It returns the home of the current user" +system environment: aString "It returns the value of the given environment variable name" +system home " It returns the home of the current user" system workingDirectory " It returns the pharo-working directory (the vm folder)" -system pwd "It returns directory where the user was at the moment of the execution of +system pwd "It returns directory where the user was at the moment of the execution of the script (the PWD environment variable) " ``` + ## Util-Finalization + ```smalltalk system exit: anErrorCode " It finishes scale given the error code to the operative system. " ``` ## Util-Image + ```smalltalk -system saveAfterRun " It set the mode of running to save after the execution of the -system script and the end of any parallel process registered for join by this script" -system saveImageAs: aFileReference " It saves the running image into a given destination" +system saveAfterRun " It set the mode of running to save after the execution of the +system script and the end of any parallel process registered for join by this script" +system saveImageAs: aFileReference " It saves the running image into a given destination" ``` ## Convenience + ```smalltalk -system registerProcessToJoin: aFuture "In your script you may want to use the force of -TaskIT that is integrated into this application. This method allows you to register -processes that you need to be finished before the image exits, but after the end +system registerProcessToJoin: aFuture "In your script you may want to use the force of +TaskIT that is integrated into this application. This method allows you to register +processes that you need to be finished before the image exits, but after the end of the script ". -system messageSend: aSelector "It returns a message send with the selector and the system -object as receiver. Useful for building callbacks" -system uimanager "It returns the uimanager" +system messageSend: aSelector "It returns a message send with the selector and the system +object as receiver. Useful for building callbacks" +system uimanager "It returns the uimanager" ``` -Doing your scripts ------------------- +# Doing your scripts -So for writing down your own scripts you can do it by editing a file with your favorite editor or you can use scale-ui. +So for writing down your own scripts you can do it by editing a file with your favorite editor or you can use scale-ui. ```bash user$ scale-ui ``` -Scale-ui will open the image of the scale tool in graphic mode, with a script browser as shown in the following images. +Scale-ui will open the image of the scale tool in graphic mode, with a script browser as shown in the following images. ![Please add an issue. Image is not loading!][image-browser] -This browser allows you to edit your scripts while browsing the system façade code, for knowing what's there ready to use. +This browser allows you to edit your scripts while browsing the system façade code, for knowing what's there ready to use. This browser as well allows you to create a new script, ![Please add an issue. Image is not loading!][image-create] ![Please add an issue. Image is not loading!][image-created] -delete an existing script and run or debug scripts on your folder. +delete an existing script and run or debug scripts on your folder. ![Please add an issue. Image is not loading!][image-debug]. During this session you may close the browser or want to open many others for different browsers (Future implementations will be happier in this aspect) @@ -317,30 +309,20 @@ For accessing this browser from the world menu, go WorldMenu> Tools> Scale> Scri ![Please add an issue. Image is not loading!][image-menu] +# Loading - - -Loading -------- - -Wanting to code? - Loading this project in a development image is really easy. Just execute the build script, it will give you as output an image in the directory called 'cache'. - If you just want to install scale in an existing image, you just need to execute in this image the content of the building script installScale.st, located into the build folder. - +Wanting to code? + Loading this project in a development image is really easy. Just execute the build script, it will give you as output an image in the directory called 'cache'. + If you just want to install scale in an existing image, you just need to execute in this image the content of the building script installScale.st, located into the build folder. ```smalltalk - Metacello new baseline: 'Scale'; repository: 'github://guillep/Scale'; load. - ``` -Or you may want to peek an eye to Iceberg project: https://github.com/npasserini/iceberg. :) - - - +Or you may want to peek an eye to Iceberg project: https://github.com/npasserini/iceberg. :) [image-browser]: https://github.com/guillep/Scale/raw/master/images/image1.png "Browser1" @@ -348,6 +330,3 @@ Or you may want to peek an eye to Iceberg project: https://github.com/npasserini [image-create]: https://github.com/guillep/Scale/raw/master/images/image3.png "Filecreate" [image-created]: https://github.com/guillep/Scale/raw/master/images/image4.png "Filecreated" [image-menu]: https://github.com/guillep/Scale/raw/master/images/image5.png "Menu" - - - diff --git a/build/build.sh b/build/build.sh index 9c38ddb..5aa1607 100755 --- a/build/build.sh +++ b/build/build.sh @@ -1,7 +1,8 @@ #!/bin/bash + set -e -#Load image for this project +# Load image for this project. rm -fr cache mkdir -p cache @@ -9,7 +10,8 @@ cd cache wget -O - get.pharo.org/50+vm | bash echo "Loading Scale and Dependencies..." -#Load stable version of the monticello configuration, according to this git sources +# Load stable version of the monticello configuration, according to +# this git sources. ./pharo Pharo.image ../build/installScale.st diff --git a/build/install.st b/build/install.st index 40f4296..715a3d3 100755 --- a/build/install.st +++ b/build/install.st @@ -1,44 +1,42 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale -| scaleParentDirectory scaleFile scaleUIFile pharoParentDirectory| +| scaleParentDirectory pharoParentDirectory scaleFile scaleUIFile | -" DEPLOY " -system stdout << 'Deploying scale command';cr. +" Scale deployment. " -scaleParentDirectory := '/usr/local/scale' asFileReference. +system stdout << 'Deploying scale command...'; cr. + +scaleParentDirectory := (system home / '.scale' / 'scale') asFileReference. +pharoParentDirectory := (system home / '.scale' / 'pharo') asFileReference. scaleParentDirectory exists ifTrue: [ - system stderr << 'There is already an installation. Please uninstall before' + system stderr << 'There is already an installation. Please uninstall before.' ] ifFalse: [ scaleParentDirectory ensureCreateDirectory. scaleFile := scaleParentDirectory / 'scale'. scaleUIFile := scaleParentDirectory / 'scale-ui'. - system workingDirectory / '..' / 'scale' copyTo: scaleFile. - system workingDirectory / '..' / 'scale-ui' copyTo: scaleUIFile. - system workingDirectory / '..' / #build / 'uninstall.st' copyTo: scaleParentDirectory / 'uninstall.st'. - system stdout << 'Deploying Pharo';cr. + system workingDirectory / '..' / 'scale' copyTo: scaleFile. + system workingDirectory / '..' / 'scale-ui' copyTo: scaleUIFile. + system workingDirectory / '..' / #build / 'uninstall.st' copyTo: scaleParentDirectory / 'uninstall.st'. + + system stdout << 'Deploying Pharo...'; cr. - pharoParentDirectory := '/usr/local/pharo' asFileReference. pharoParentDirectory ensureCreateDirectory. - #( 'pharo' 'pharo-vm' 'pharo-ui') + #( 'pharo' 'pharo-vm' 'pharo-ui' ) do: [ :file | system workingDirectory / file copyAllTo: pharoParentDirectory / file ]. - #( 'Pharo.image' 'Pharo.changes') + #( 'Pharo.image' 'Pharo.changes' ) do: [ :file | system workingDirectory / file copyAllTo: scaleParentDirectory / file ]. - - system stdout << 'Giving permissions to run';cr. + system stdout << 'Giving execute permissions...'; cr. system call: 'chmod +x ', (pharoParentDirectory / 'pharo') fullName. system call: 'chmod +x ', (pharoParentDirectory / 'pharo-ui') fullName. system call: 'chmod +x ', (pharoParentDirectory / 'pharo-vm/pharo') fullName. - system call: 'chmod +x ', (scaleParentDirectory / 'uninstall.st') fullName. + system call: 'chmod +x ', (scaleParentDirectory / 'uninstall.st') fullName. system call: 'chmod +x ', scaleFile fullName. system call: 'chmod +x ', scaleUIFile fullName. - system ln: scaleFile to: '/usr/local/bin/scale' asFileReference. - system ln: scaleUIFile to: '/usr/local/bin/scale-ui' asFileReference. - system stdout << 'Done!'. - - + system stdout << 'Successfully installed Scale! Now, add the Scale binaries to your $PATH:'; cr. + system stdout << ('export PATH="{1}:$PATH"' format: { ('$HOME/', '.scale/', 'scale') }); cr. ]. diff --git a/build/scale-bootstrap b/build/scale-bootstrap index 5e7de5e..3b5c604 100755 --- a/build/scale-bootstrap +++ b/build/scale-bootstrap @@ -1,3 +1,3 @@ #!/bin/bash -./cache/pharo cache/Pharo.image scale "../$@" +./cache/pharo ./cache/Pharo.image scale "../$@" diff --git a/build/uninstall.st b/build/uninstall.st index 51c7ff6..bb6f889 100755 --- a/build/uninstall.st +++ b/build/uninstall.st @@ -1,28 +1,15 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale -| scapeParentDirectory pharoParentDirectory 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 " -scaleX := '/usr/local/bin/scale' asFileReference. -scaleX exists ifTrue: [ system call: ' rm ', scaleX fullName ]. -system stdout << 'Uninstalling executable scale' << String cr ; flush. - -scaleuiX:='/usr/local/bin/scale-ui' asFileReference. -scaleuiX exists ifTrue: [ system call: ' rm ', scaleuiX fullName ]. -system stdout << 'Uninstalling executable scale-ui' << String cr ; flush. - -scapeParentDirectory := '/usr/local/scale' asFileReference. -pharoParentDirectory := '/usr/local/pharo' asFileReference. - -scapeParentDirectory exists ifTrue: [ system call: ' rm -rf ', scapeParentDirectory fullName ]. -system stdout << 'Removing scale folder' << String cr ; flush. - -pharoParentDirectory exists ifTrue: [ system call: ' rm -rf ', pharoParentDirectory fullName ]. -system stdout << 'Removing pharo folder' << String cr ; flush. +scaleParentDirectory := (system home / '.scale') asFileReference. +system stdout << 'Removing scale folder...' << String cr ; flush. +scaleParentDirectory exists ifTrue: [ system call: ' rm -rf ', scaleParentDirectory fullName ]. system stdout << 'Done!' << String cr. diff --git a/examples/callFailingScript.st b/examples/callFailingScript.st index 0cd83ec..f5c00ae 100755 --- a/examples/callFailingScript.st +++ b/examples/callFailingScript.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale system stdout << 'Doing a wrong call'. system stdout cr. diff --git a/examples/download.st b/examples/download.st index 2d9e187..37f1fbf 100755 --- a/examples/download.st +++ b/examples/download.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | version | version := (system arguments optionAt: #v ifAbsent: [ 50 ]) asInteger. diff --git a/examples/echoer.st b/examples/echoer.st index 57ed594..1217af8 100755 --- a/examples/echoer.st +++ b/examples/echoer.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | got | diff --git a/examples/fact.st b/examples/fact.st index 821bad0..e1f251e 100755 --- a/examples/fact.st +++ b/examples/fact.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | fact | diff --git a/examples/failurecode.st b/examples/failurecode.st index 4bc19e8..7d39cde 100755 --- a/examples/failurecode.st +++ b/examples/failurecode.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale system stdout << 'print to stdout';cr. diff --git a/examples/ls.st b/examples/ls.st index a17dcab..294472d 100755 --- a/examples/ls.st +++ b/examples/ls.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale (system call: 'ls -l') lines do: [ :line | system stdout << line. diff --git a/examples/lsst.st b/examples/lsst.st index a576f66..41a64c2 100755 --- a/examples/lsst.st +++ b/examples/lsst.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale system pwd entries do: [ :entry | system stdout << entry asString. diff --git a/examples/parallel-call.st b/examples/parallel-call.st index 4b68def..768fc7d 100755 --- a/examples/parallel-call.st +++ b/examples/parallel-call.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | futurels | diff --git a/examples/parallel-call2.st b/examples/parallel-call2.st index b5a208f..796f406 100755 --- a/examples/parallel-call2.st +++ b/examples/parallel-call2.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | futurels | diff --git a/examples/parallel-error-call.st b/examples/parallel-error-call.st index 0ee3997..f1702a0 100755 --- a/examples/parallel-error-call.st +++ b/examples/parallel-error-call.st @@ -1,4 +1,4 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale | futurels | diff --git a/examples/pwd.st b/examples/pwd.st new file mode 100755 index 0000000..4c238f5 --- /dev/null +++ b/examples/pwd.st @@ -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') diff --git a/examples/stdout.st b/examples/stdout.st index 0ab7b6f..d673514 100755 --- a/examples/stdout.st +++ b/examples/stdout.st @@ -1,3 +1,3 @@ -#!/usr/local/bin/scale +#!/usr/bin/env scale system stdout << 'hello' diff --git a/scale b/scale index c25d979..54c0963 100755 --- a/scale +++ b/scale @@ -1,3 +1,3 @@ #!/bin/bash -/usr/local/pharo/pharo /usr/local/scale/Pharo.image scale "$@" +${HOME}/.scale/pharo/pharo ${HOME}/.scale/scale/Pharo.image scale "$@" diff --git a/scale-ui b/scale-ui index e2374e9..6513181 100755 --- a/scale-ui +++ b/scale-ui @@ -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 "$@" diff --git a/setupScale.sh b/setupScale.sh index 15169aa..cb051e3 100755 --- a/setupScale.sh +++ b/setupScale.sh @@ -1,11 +1,5 @@ #!/bin/sh - -if [ "$(id -u)" != "0" ]; then - echo "Sudo privs needed for the tool installation " - exit 1 -fi - echo "*********************************************" echo "* cloning repository " echo "*********************************************" @@ -27,5 +21,3 @@ echo "*********************************************" echo "* Cleaning the mess :) " echo "*********************************************" rm /tmp/scale -rf - - diff --git a/setupScaleDev.sh b/setupScaleDev.sh index a316702..7df01dc 100755 --- a/setupScaleDev.sh +++ b/setupScaleDev.sh @@ -1,11 +1,5 @@ #!/bin/sh - -if [ "$(id -u)" != "0" ]; then - echo "Sudo privs needed for the tool installation " - exit 1 -fi - echo "*********************************************" echo "* cloning repository " echo "*********************************************" @@ -27,5 +21,3 @@ echo "*********************************************" echo "* Cleaning the mess :) " echo "*********************************************" rm /tmp/scale -rf - - diff --git a/src/Scale.package/SCScaleCodeManager.class/class/interpreter.st b/src/Scale.package/SCScaleCodeManager.class/class/interpreter.st index 74d3652..8cb0fb8 100644 --- a/src/Scale.package/SCScaleCodeManager.class/class/interpreter.st +++ b/src/Scale.package/SCScaleCodeManager.class/class/interpreter.st @@ -1,3 +1,3 @@ as yet unclassified interpreter - ^ '#!/usr/local/bin/scale' \ No newline at end of file + ^ '#!/usr/bin/env scale'