mirror of https://github.com/bitwarden/cli.git
4 changed files with 30 additions and 77 deletions
@ -1 +1 @@
@@ -1 +1 @@
|
||||
Subproject commit d3f3f47286f2cb0f35b08af9afec84cdf6182994 |
||||
Subproject commit 43ac05d1fc89a5132bd2eb632a85e608e2548252 |
||||
@ -1,63 +0,0 @@
@@ -1,63 +0,0 @@
|
||||
#!/usr/bin/env bash |
||||
set -e |
||||
|
||||
# Dependencies: |
||||
# 1. brew install jq |
||||
# 2. fork of homebrew-cask repo setup. |
||||
# see https://github.com/caskroom/homebrew-cask/blob/master/CONTRIBUTING.md#getting-set-up-to-contribute |
||||
# |
||||
# To run: |
||||
# sh ./cask-update.sh |
||||
# |
||||
# then submit PR from fork repo |
||||
|
||||
FORK_GITHUB_USER="kspearrin" |
||||
APP_NAME="Bitwarden CLI" |
||||
PROJECT_NAME="bitwarden-cli" |
||||
GITHUB_RELEASE_FEED="https://github.com/bitwarden/cli/releases.atom" |
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" |
||||
PWD_DIR="$(pwd)" |
||||
ROOT_DIR="$DIR/.." |
||||
DIST_DIR="$ROOT_DIR/dist" |
||||
CASK_DIR="$ROOT_DIR/stores/homebrew-cask" |
||||
DIST_CASK_DIR="$DIST_DIR/homebrew-cask" |
||||
GIT_CASKS_DIR=""$(brew --repository)"/Library/Taps/caskroom/homebrew-cask/Casks" |
||||
|
||||
if [ -d "$DIST_CASK_DIR" ] |
||||
then |
||||
rm -rf $DIST_CASK_DIR |
||||
fi |
||||
|
||||
cp -r $CASK_DIR $DIST_DIR |
||||
|
||||
SRC_PACKAGE="$ROOT_DIR/package.json"; |
||||
SRC_PACAKGE_VERSION=$(jq -r '.version' $SRC_PACKAGE) |
||||
|
||||
|
||||
ZIP_FILE="bw-macos-$SRC_PACAKGE_VERSION.zip" |
||||
ZIP_URL="https://github.com/bitwarden/cli/releases/download/v$SRC_PACAKGE_VERSION/$ZIP_FILE" |
||||
curl $ZIP_URL |
||||
CHECKSUM=($(shasum -a 256 $ZIP_FILE)) |
||||
rm $ZIP_FILE |
||||
CHECKPOINT=$(brew cask _appcast_checkpoint --calculate "$GITHUB_RELEASE_FEED") |
||||
RB="$DIST_CASK_DIR/$PROJECT_NAME.rb" |
||||
RB_NEW="$DIST_CASK_DIR/$PROJECT_NAME.rb.new" |
||||
|
||||
sed -e 's/__version__/'"$SRC_PACAKGE_VERSION"'/g; s/__checksum__/'"$CHECKSUM"'/g; s/__checkpoint__/'"$CHECKPOINT"'/g' $RB > $RB_NEW |
||||
mv -f $RB_NEW $RB |
||||
|
||||
cd $GIT_CASKS_DIR |
||||
git checkout master |
||||
git pull |
||||
git reset --hard origin/master |
||||
git push $FORK_GITHUB_USER master |
||||
git push -d $FORK_GITHUB_USER $PROJECT_NAME || true |
||||
git branch -D $PROJECT_NAME || true |
||||
git checkout -b $PROJECT_NAME |
||||
GIT_CASKS_RB="$GIT_CASKS_DIR/$PROJECT_NAME.rb" |
||||
cp $RB $GIT_CASKS_RB |
||||
git add $GIT_CASKS_RB |
||||
git commit -m "Update $APP_NAME to v$SRC_PACAKGE_VERSION" |
||||
git push $FORK_GITHUB_USER $PROJECT_NAME |
||||
cd $PWD_DIR |
||||
@ -1,13 +0,0 @@
@@ -1,13 +0,0 @@
|
||||
cask 'bitwarden-cli' do |
||||
version '__version__' |
||||
sha256 '__checksum__' |
||||
|
||||
# github.com/bitwarden/cli was verified as official when first introduced to the cask |
||||
url "https://github.com/bitwarden/cli/releases/download/v#{version}/bw-macos-#{version}.zip" |
||||
appcast 'https://github.com/bitwarden/cli/releases.atom', |
||||
checkpoint: '__checkpoint__' |
||||
name 'Bitwarden CLI' |
||||
homepage 'https://bitwarden.com/' |
||||
|
||||
binary "#{appdir}/bw" |
||||
end |
||||
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
require "language/node" |
||||
|
||||
class BitwardenCli < Formula |
||||
desc "Secure and free password manager for all of your devices" |
||||
homepage "https://bitwarden.com/" |
||||
url "https://registry.npmjs.org/@bitwarden/cli/-/cli-__version__.tgz" |
||||
sha256 "__checksum__" |
||||
|
||||
bottle do |
||||
cellar :any_skip_relocation |
||||
sha256 "b343fbe9055736148f542a3529e755562b624803e6f878dceba318de21766bf6" => :high_sierra |
||||
sha256 "8153ee1287b22a3de47d1b532fef818c7e77ce30dbfc72c6a72551266f38bc70" => :sierra |
||||
sha256 "67f66f94876ccc0bc0936f0306d072cf7d463b48b1e683eaadc8798a6ef3dab2" => :el_capitan |
||||
end |
||||
|
||||
depends_on "node" |
||||
|
||||
def install |
||||
system "npm", "install", *Language::Node.std_npm_install_args(libexec) |
||||
bin.install_symlink Dir["#{libexec}/bin/*"] |
||||
end |
||||
|
||||
test do |
||||
assert_equal 10, shell_output("#{bin}/bw generate --length 10").chomp.length |
||||
|
||||
output = pipe_output("#{bin}/bw encode", "Testing", 0) |
||||
assert_equal "VGVzdGluZw==", output.chomp |
||||
end |
||||
end |
||||
Loading…
Reference in new issue