Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Klesse committed Apr 16, 2021
1 parent 46d2274 commit 9db05f1
Show file tree
Hide file tree
Showing 9 changed files with 176 additions and 4 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Publish

on:
release:
types:
- released

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v1
- name: Node 14.6
uses: actions/setup-node@v1
with:
node-version: 14.6
- name: Publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,75 @@
/build
/src/.slack
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/slack-cli.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"name": "slack-cli",
"version": "0.0.1",
"description": "A fork from rockymadden/slack-cli",
"bin": {
"slack-cli": "src/slack"
},
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/lenneTech/slack-cli.git"
},
"keywords": [
"slack",
"cli",
"tool",
"awesome"
],
"author": "Pascal Klesse",
"license": "ISC",
"bugs": {
"url": "https://github.com/lenneTech/slack-cli/issues"
},
"homepage": "https://github.com/lenneTech/slack-cli#readme",
"dependencies": {}
}
20 changes: 16 additions & 4 deletions src/slack
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ case "${cmd}${1}" in
presenceactive|presenceaway|\
reminderadd|remindercomplete|reminderdelete|reminderinfo|reminderlist| \
snoozeend|snoozeinfo|snoozestart|\
statusclear|statusedit)
statusclear|statusedit|statusget)
sub=${1} ; shift
;;
esac
Expand Down Expand Up @@ -410,6 +410,9 @@ function help() {
echo " ${bin} status edit [<text> [<emoji>]]"
echo ' [--compact|-c] [--filter|-f <filter>] [--monochrome|-m] [--trace|-x]'
echo
echo " ${bin} status get"
echo ' [--compact|-c] [--filter|-f <filter>] [--monochrome|-m] [--trace|-x]'
echo
echo 'Configuration Commands:'
echo ' init Initialize'
echo
Expand Down Expand Up @@ -443,9 +446,10 @@ function help() {
echo 'Status Commands:'
echo ' status clear Clear status'
echo ' status edit Edit status'
echo ' status get Get status'
echo
echo 'More Information:'
echo ' repo https://github.com/rockymadden/slack-cli'
echo ' repo https://github.com/lenneTech/slack-cli'
}

function filedelete() {
Expand Down Expand Up @@ -655,8 +659,16 @@ function statusedit() {
jqify "${msg}"
}

function statusget() {
local msg=$(\
curl -s https://slack.com/api/users.profile.get \
--data-urlencode "token=${token}")

jqify "${msg}"
}

function version() {
echo '0.18.0'
echo '0.0.1'
}

# COMMAND ROUTING #################################################################################
Expand All @@ -669,7 +681,7 @@ case "${cmd}${sub}" in
presenceactive|presenceaway|\
reminderadd|remindercomplete|reminderdelete|reminderinfo|reminderlist|\
snoozeend|snoozeinfo|snoozestart|\
statusclear|statusedit)
statusclear|statusedit|statusget)
if [ -z "${token}" ]; then
echo '{"ok": false, "error": "not_inited"}' |
jq -r ${compact} ${monochrome} "${filter:=.}" ; exit 1
Expand Down

0 comments on commit 9db05f1

Please sign in to comment.