Skip to content

Instantly share code, notes, and snippets.

@aimxhaisse
Last active August 29, 2015 14:20
Show Gist options
  • Save aimxhaisse/6b2e97bd5ab700f23e20 to your computer and use it in GitHub Desktop.
Save aimxhaisse/6b2e97bd5ab700f23e20 to your computer and use it in GitHub Desktop.
How to validate a Pathwar coupon
#!/usr/bin/env bash
# This is a script shell that validates a Pathwar coupon
# It uses the pathwar cli tool, available at:
#
# - https://github.com/pathwar/node-pathwar
# this is the coupon you want to validate
coupon=$1
# this is *your* pathwar token, you can fetch it by analyzing the HTTP requests on the portal
# we will soon provide a page on your account to display the token.
export pathwar_token=
# fetch the id of the Epitech session
session=$(pathwar ls sessions name=Epitech2015 -q)
# get the id of your team in the Epitech session
organization=$(pathwar ls teams session=$session -q)
# validate the coupon for your team
pathwar add organization-coupons organization=$organization coupon=$coupon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment