Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Begin versioning spacefish releases (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
matchai authored Jul 29, 2018
1 parent cb21d72 commit e9dede0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions fish_prompt.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function fish_prompt
# Store the exit code of the last command
set -g sf_exit_code $status
set -g SPACEFISH_VERSION 0.1.0

# ------------------------------------------------------------------------------
# Configuration
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "spacefish",
"version": "1.0.0",
"version": "0.1.0",
"description": "A Fish Shell prompt for Astronauts",
"repository": "[email protected]:matchai/spacefish.git",
"author": "Matan Kushner <[email protected]>",
"scripts": {
"test": "fish -c \"fisher fishtape; and fishtape tests/*.test.fish\"",
"test": "tests/run.fish",
"version": "scripts/version.fish",
"docs:prepare": "gitbook install",
"docs:serve": "npm run docs:prepare && gitbook serve .",
"docs:build": "npm run docs:prepare && gitbook build"
Expand Down
10 changes: 10 additions & 0 deletions scripts/version.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env fish

# Set the global "SPACEFISH_VERSION" variable to have the same version as is in package.json
set -l new_version (grep -E '"version": "v?([0-9]+\.){1,}' package.json | cut -d\" -f4 2> /dev/null)
set -l filename $PWD/fish_prompt.fish
sed -e "s/set -g SPACEFISH_VERSION .*/set -g SPACEFISH_VERSION $new_version/g" $filename > $filename.bak
mv -- $filename.bak $filename
git add fish_prompt.fish
1 change: 1 addition & 0 deletions tests/run.fish
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env fish

set -l gitRoot (git rev-parse --show-toplevel)
set -l testDir (dirname (status --current-filename))
set -l tmpDir /tmp/spacefish
Expand Down

0 comments on commit e9dede0

Please sign in to comment.