Skip to content

Commit

Permalink
Version 0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fsavje committed Aug 19, 2017
1 parent 9c2da64 commit a716172
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 33 deletions.
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# math-with-slack 0.2.2

* Minor fixes.


# math-with-slack 0.2.1

* Minor fixes.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Download and run your platform's script. Restart the Slack client. You're done!
Run the following in a terminal:

```shell
curl -OL https://github.com/fsavje/math-with-slack/releases/download/v0.2.1/math_with_slack.sh
curl -OL https://github.com/fsavje/math-with-slack/releases/download/v0.2.2/math_with_slack.sh
sudo bash math_with_slack.sh
```


### Windows

[Download the script](https://github.com/fsavje/math-with-slack/releases/download/v0.2.1/math_with_slack.bat) and double-click to run. Alternatively, run it in the command prompt with:
[Download the script](https://github.com/fsavje/math-with-slack/releases/download/v0.2.2/math_with_slack.bat) and double-click to run. Alternatively, run it in the command prompt with:

```shell
math_with_slack.bat
Expand Down
24 changes: 9 additions & 15 deletions math_with_slack.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

:: Constants

SET "MWS_VERSION=v0.2.1"
SET "MWS_VERSION=v0.2.2"


:: User input
Expand All @@ -44,17 +44,16 @@ IF "%SLACK_DIR%" == "" (
FOR /F %%t IN ('DIR /B /OD %UserProfile%\AppData\Local\slack\app-?.*.*') DO (
SET SLACK_DIR=%UserProfile%\AppData\Local\slack\%%t\resources\app.asar.unpacked\src\static
)
IF "%SLACK_DIR%" == "" (
ECHO Cannot find Slack installation.
PAUSE & EXIT /B 1
) ELSE (
ECHO Found Slack installation at: %SLACK_DIR%
)
)


:: Check so installation exists

IF "%SLACK_DIR%" == "" (
ECHO Cannot find Slack installation.
PAUSE & EXIT /B 1
)

IF NOT EXIST "%SLACK_DIR%" (
ECHO Cannot find Slack installation at: %SLACK_DIR%
PAUSE & EXIT /B 1
Expand All @@ -66,12 +65,7 @@ IF NOT EXIST "%SLACK_DIR%\ssb-interop.js" (
)


:: Unistall version 0.1
:: (Remove this eventually)

IF EXIST "%SLACK_DIR%\index.js.mwsbak" (
MOVE /Y "%SLACK_DIR%\index.js.mwsbak" "%SLACK_DIR%\index.js" >NUL
)
ECHO Using Slack installation at: %SLACK_DIR%


:: Remove previous version
Expand All @@ -93,7 +87,7 @@ IF %ERRORLEVEL% NEQ 0 ( PAUSE & EXIT /B 1 )
:: Are we uninstalling?

IF "%UNINSTALL%" == "-u" (
ECHO math-with-slack has been uninstalled. Please restart Slack client.
ECHO math-with-slack has been uninstalled. Please restart the Slack client.
PAUSE & EXIT /B 0
)

Expand Down Expand Up @@ -150,7 +144,7 @@ IF %ERRORLEVEL% NEQ 0 ( PAUSE & EXIT /B 1 )

:: We're done

ECHO math-with-slack has been installed. Please restart Slack client.
ECHO math-with-slack has been installed. Please restart the Slack client.
PAUSE & EXIT /B 0


Expand Down
23 changes: 7 additions & 16 deletions math_with_slack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## Constants

MWS_VERSION="v0.2.1"
MWS_VERSION="v0.2.2"


## Functions
Expand Down Expand Up @@ -66,31 +66,22 @@ if [ -z "$SLACK_DIR" ]; then
break
fi
done
if [ -z "$SLACK_DIR" ]; then
error "Cannot find Slack installation."
else
echo "Found Slack installation at: $SLACK_DIR"
fi
fi


## Check so installation exists and is writable

if [ ! -e "$SLACK_DIR" ]; then
if [ -z "$SLACK_DIR" ]; then
error "Cannot find Slack installation."
elif [ ! -e "$SLACK_DIR" ]; then
error "Cannot find Slack installation at: $SLACK_DIR"
elif [ ! -e "$SLACK_DIR/ssb-interop.js" ]; then
error "Cannot find Slack file: $SLACK_DIR/ssb-interop.js"
elif [ ! -w "$SLACK_DIR/ssb-interop.js" ]; then
error "Cannot write to Slack file: $SLACK_DIR/ssb-interop.js"
fi


## Unistall version 0.1
## (Remove this eventually)

if [ -e "$SLACK_DIR/index.js.mwsbak" ]; then
mv -f $SLACK_DIR/index.js.mwsbak $SLACK_DIR/index.js
fi
echo "Using Slack installation at: $SLACK_DIR"


## Remove previous version
Expand Down Expand Up @@ -122,7 +113,7 @@ restore_file $SLACK_DIR/ssb-interop-lite.js
## Are we uninstalling?

if [ -n "$UNINSTALL" ]; then
echo "$(tput setaf 64)math-with-slack has been uninstalled. Please restart Slack client.$(tput sgr0)"
echo "$(tput setaf 64)math-with-slack has been uninstalled. Please restart the Slack client.$(tput sgr0)"
exit 0
fi

Expand Down Expand Up @@ -196,5 +187,5 @@ inject_loader $SLACK_DIR/ssb-interop-lite.js

## We're done

echo "$(tput setaf 64)math-with-slack has been installed. Please restart Slack client.$(tput sgr0)"
echo "$(tput setaf 64)math-with-slack has been installed. Please restart the Slack client.$(tput sgr0)"

0 comments on commit a716172

Please sign in to comment.