Skip to content

Commit

Permalink
fix: Transfer to organization.
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Buck committed May 13, 2020
1 parent 4e22ef8 commit ce3691a
Show file tree
Hide file tree
Showing 14 changed files with 882 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.idea/
*.swp
.DS_Store
ws.tgz
29 changes: 26 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
WS_PREFIX ?= $(HOME)/ws
VERSION:=$(shell semtag final -s minor -o)

#:help: help | Displays the GNU makefile help
.PHONY: help
help: ; @sed -n 's/^#:help://p' Makefile

#:help: lint | Lint the project files using pre-commit
.PHONY: lint
lint:
#:help: precommit | Lint the project files using pre-commit
.PHONY: precommit
precommit:
@pre-commit run --all-files

#:help: changever | Change the product version to the next consecutive version number.
.PHONY: changever
changever:
@find bin -type f -name ws -exec sed -i "" "s/VERSION=.*/VERSION=\"$(VERSION)\"/g" {} \;
@git add bin/ws && git commit -m "Updated VERSION"

#:help: changelog | Build the changelog
.PHONY: changelog
changelog:
Expand All @@ -21,3 +28,19 @@ changelog:
release:
@semtag final -s minor
@git push --follow-tags

#:help: install | Installs the product, leaving the workspaces behind.
.PHONY: install
install: bin/ws
mkdir -p $(WS_PREFIX)/$(dir $<)
cp $< $(WS_PREFIX)/$<

#:help: uninstall | Uninstalls the product, leaving the workspaces behind.
.PHONY: uninstall
uninstall:
rm -f $(WS_PREFIX)/bin/ws

#:help: version | Show the next version
.PHONY: version
version:
@echo $(VERSION)
115 changes: 113 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,114 @@
# {{ repository-name }}
# `ws` – Interactively Manage Your Development Workspaces

Project brief description.
Workspace management: no subshells, no profile setup, **simply extensible**.

![usage animation](img/ws.gif)

(Note: `ws` is not supported natively on Windows.)

- [`ws` – Interactively Manage Your Development Workspaces](#ws-%e2%80%93-interactively-manage-your-development-workspaces)
- [Installation](#installation)
- [Third Party Installers](#third-party-installers)
- [Creating Workspaces](#creating-workspaces)
- [Removing Workspaces](#removing-workspaces)
- [Removing Versions](#removing-versions)
- [Miscellaneous](#miscellaneous)
- [Optional Environment Variables](#optional-environment-variables)

## Installation

The easiest way to install `ws` is through the web:

curl -L https://git.io/ws-get | bash -s -- install

Once installed, `ws` creates workspaces in subdirectory `ws/workspaces` of the directory specified in environment variable `WS_PREFIX`, which defaults to `$HOME/ws`.

-----

Alternatively, you can clone this repo and

make install

to install `ws` to `bin/ws` of the directory specified in the environment variable `$PREFIX`, which defaults to `$HOME/ws`. To install `ws` in a custom location (such as `$CUSTOM_LOCATION/bin/ws`), run `PREFIX=$CUSTOM_LOCATION make install`.

### Third Party Installers

On Linux and macOS, [ws-get](https://github.com/continuul/ws-get) allows installation directly from GitHub; for instance:

curl -L https://raw.githubusercontent.com/continuul/ws-get/master/bin/ws-get | bash

ws-get sets `WS_PREFIX` to `$HOME/ws`, installs `ws` to `$HOME/ws/bin`, modifies the initialization files of supported shells to export `WS_PREFIX` and add `$HOME/ws/bin` to the `PATH`.

## Creating Workspaces

Simply execute `ws <workspace>` to create a workspace of the specified name. If `<workspace>` has already been created, `ws` will set it as the active workspace.

ws buffalo
ws cheetah
ws dolphin

Execute `ws` on its own to view your workspaces, and select the desired workspace.

$ ws

buffalo
ο cheetah
dolphin

Use up/down arrow keys to select a workspace, return key to install, d to delete, q to quit

(You can also use `j` and `k` to navigate up or down without using arrows.)

If the active workspace does not change after install, try opening a new shell in case seeing a stale workspace.

## Renaming Workspaces

It is occasionally useful to rename a workspace. There are two straight-forward
methods to accomplish this; the less easy, and very easy.

The hard way is the following. Knowing that `WS_HOME` (`WS_PREFIX`) is the home
directory for all your workspaces, simply run a shell `mv` command to move the
workspace directory:

mv $WS_HOME/workspaces/source $WS_HOME/workspaces/target

The easy (and equivalent) way is the following. If a `<source>` workspace
already exists and you want to rename it to `<target>`:

ws mv <source> <target>

## Removing Workspaces

Remove some cached versions:

ws rm buffalo

Removing all local workspaces except the current workspace:

ws prune

Remove the installed node and npm (does not affect the cached version). This can be useful
to revert to the system version of node (if in a different location), or if you no longer
wish to use node and npm, or are switching to a different way of managing them.

ws uninstall

## Miscellaneous

Command line help can be obtained from `ws --help`.

List local workspaces:

ws ls

Display diagnostics to help resolve problems:

ws doctor

## Optional Environment Variables

The `ws` command creates workspaces in `$HOME/ws` by default, but you may override this location by defining `WS_PREFIX`.
To change the location to say `$HOME/.ws`, add lines like the following to your shell initialization file:

export WS_PREFIX=$HOME/.ws
export PATH=$WS_PREFIX/bin:$PATH
45 changes: 45 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Releasing ws

Don't manually change the version number or CHANGELOG, as they are updated
by maintainers using the tools below when a release is prepared.

## tl;dr

```console
make changever
make release
make changelog
```

## Pre-commit

Git pre-commit are integrated and permit adding source code checks, such
as lint tools, fixes end of files and trailing whitespace. No special
accommodation must be applied other than what the commit process triggers
to ensure code cleanliness.

## Changelog

The git-chglog generator automatically generates the CHANGELOG. The changelog
tool organizes commits by release; thus a release must have been prepared
before changelog can generate its applicable section. The latest commits
simply appear in a pre-release section.

The changelog is generated after tagging occurs.

## Version String

The `ws` script contains a string constant of the version tag. This constant
must be updated prior to release tagging.

## Required Tools

To contribute, please install and use the following tools:

- [git-chglog][git-chglog] - CHANGELOG generator implemented in Go
- [pre-commit][pre-commit] - Git hook scripts useful for identifying simple issues before submission to code review
- [semtag][semtag] - Semantic tagging script for Git

[pre-commit]: https://pre-commit.com/
[git-chglog]: https://github.com/git-chglog/git-chglog
[semtag]: https://github.com/pnikosis/semtag
Loading

0 comments on commit ce3691a

Please sign in to comment.