Skip to content

Commit

Permalink
Merge pull request #5 from Megapixel99/develop
Browse files Browse the repository at this point in the history
Bumped version to 1.0.2 and added build script
  • Loading branch information
Megapixel99 authored Apr 3, 2020
2 parents aaf506c + 453ad97 commit 7150519
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 9 deletions.
19 changes: 12 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Pull requests are welcome. For major changes, please open an issue first to
discuss what you would like to change.

Please only bump the version in the develop branch, and do all work in other branches
which branch off of develop.

### Set up your environment
##### Prerequisites:
Expand All @@ -11,18 +15,19 @@ Please run the following commands in the root directory of the project:
```bash
$ npm i
```
and
```bash
$ npm install -g pkg
```

##### Building/Releasing:
Before releasing any new versions, please build the project binary(s) using:
```bash
$ pkg --out-path $PATH_TO_PROJECT/GAM/binarys PATH_TO_PROJECT/GAM/src/manager.js
$ ./build.sh
```
`pkg` may not work with some later versions of NodeJS, if this is the case for your current version of NodeJS, please upgrade/downgrade your NodeJS version using a version manager such as [n](https://www.npmjs.com/package/n) or [nvm](https://github.com/nvm-sh/nvm)
`pkg`, which is installed in `build.sh`, and required to build the project executables,
may not work with some later versions of NodeJS, if this is the case for your current
version of NodeJS, please upgrade/downgrade your NodeJS version using a version
manager such as [n](https://www.npmjs.com/package/n) or [nvm](https://github.com/nvm-sh/nvm)

##### To Do:
- Modify build script for Windows and Linux
- Add CLI option to view current alias
- Add CLI option to create backups of SSH keys (In progress)
- Fix issue in the use of `sudo` build script with zshell.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ the old keys into the new one to use this CLI application.****
## Contributing
Please see `CONTRIBUTING.md`

## Known Issues
If you run `build.sh` in zshell, you may receive:
```
zsh compinit: insecure directories and files, run compaudit for list.
Ignore insecure directories and files and continue [y] or abort compinit [n]?
```
If you receive this, please run `build.sh` again and the error will not appear.

## License
```
Copyright 2020 Seth Wheeler
Expand Down
50 changes: 50 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Licensed under Apache Version 2.0
# Please see the LICENSE file in the root directory of the project for more
# information

#!/usr/bin/env bash

if [ "$(whoami)" != "root" ]
then
echo "The root user is required to install the packages required to build the application"
echo "Please enter your password to continue"
sudo -s
fi

if ! foobar_loc="$(type -p "npm")" || [[ -z $foobar_loc ]]; then
echo "Could not find npm, please install npm"
echo ""
else
echo "Installing the projects' dependencies..."
npm install -s
while ! foobar_loc="$(type -p "pkg")" || [[ -z $foobar_loc ]]
do
read -p "Could not find pkg, which is reqiured to build GAM. Do you want to install pkg? (y/n)" choice
case "$choice" in
y|Y|yes|Yes ) sudo npm i -g pkg -s
echo "Installed pkg successfully";;
n|N|no|No ) echo "pkg is required to build, exiting program";;
* ) echo "Invalid response, please try again";;
esac
done
fi

echo ""
mkdir -p binarys
echo "Creating binarys..."
echo ""
pkg --out-path $PWD/binarys $PWD/src/manager.js
echo "Created binarys successfully"
echo ""

while true
do
read -p "Do you want to uninstall pkg? (y/n)" choice
case "$choice" in
y|Y|yes|Yes ) sudo npm i -g pkg -s
echo "Uninstalled pkg successfully"
break;;
n|N|no|No ) break;;
* ) echo "Invalid response, please try again";;
esac
done
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gam",
"version": "1.0.1",
"version": "1.0.2",
"description": "GAM is a NodeJS application for managing multiple Git accounts (aliases).",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 7150519

Please sign in to comment.