Skip to content

Commit

Permalink
Merge pull request #10 from vgeruso/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
vgeruso authored Nov 27, 2021
2 parents d739111 + d4186e6 commit 90ca849
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The cpn requires the following systems installed:
In the root directory `~/` execute:

```bash
$ wget https://raw.githubusercontent.com/vgeruso/cpn/1.2.1/install.sh
$ wget https://raw.githubusercontent.com/vgeruso/cpn/1.2.2/install.sh
```

```bash
Expand Down
13 changes: 1 addition & 12 deletions cpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,5 @@ if test $1
then
bash $CPN_DIR/src/options.sh $1 $2
else
echo "cpn version 1.2.0"
echo
echo "Usage: cpn <command> [<arg>]"
echo
echo "These are common cpn commands:"
echo
echo "Start a working area:"
echo " init <name project> Create you project api node"
echo
echo "Perform maintenance on your cpn"
echo " update Update cpn on your machine"
echo " uninstall Uninstal cpn from your machine"
bash $CPN_DIR/src/help.sh
fi
8 changes: 7 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ sudo chomd 733 ./src/init.sh
sudo chmod 733 ./src/options.sh
sudo chmod 733 ./src/uninstall.sh
sudo chmod 733 ./src/update.sh
sudo chomd 733 ./src/help.sh
sudo chomd 733 ./src/version.sh

sudo cp cpn.sh /usr/bin
cd /usr/bin
Expand All @@ -18,29 +20,33 @@ cd ~/

if test $HOME/.bash_profile
then
echo -e
echo -e '#cpn' >> .bash_profile
echo -e 'export CPN_DIR="${HOME}/.cpn"' >> .bash_profile
fi

if test $HOME/.zshrc
then
echo -e
echo -e '#cpn' >> .zshrc
echo -e 'export CPN_DIR="${HOME}/.cpn"' >> .zshrc
fi

if test $HOME/.profile
then
echo -e
echo -e '#cpn' >> .profile
echo -e 'export CPN_DIR="${HOME}/.cpn"' >> .profile
fi

if test $HOME/.bashrc
then
echo -e
echo -e '#cpn' >> .bashrc
echo -e 'export CPN_DIR="${HOME}/.cpn"' >> .bashrc
fi

echo
$CPN_DIR/src/help.sh
bash $CPN_DIR/src/help.sh

rm install.sh
7 changes: 4 additions & 3 deletions src/help.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
echo "cpn version 1.2.1"
echo "cpn version 1.2.2"
echo
echo "Usage: cpn [<flag>] <command> [<arg>]"
echo "Usage: cpn [<flag>] [<command>] [<arg>]"
echo
echo "These are common cpn commands:"
echo
Expand All @@ -12,4 +12,5 @@ echo " update Update cpn on your machine"
echo " uninstall Uninstal cpn from your machine"
echo
echo "These are common cpn flags:"
echo " -h or --help Show this help list"
echo " -h or --help Show this help list"
echo " -v or --version Show version cpn"
13 changes: 11 additions & 2 deletions src/options.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ fi

if test $1 == "update"
then
# bash $CPN_DIR/src/update.sh
echo "Update => $1 => In development"
bash $CPN_DIR/src/update.sh
fi

if test $1 == "-h"
Expand All @@ -23,4 +22,14 @@ fi
if test $1 == "--help"
then
bash $CPN_DIR/src/help.sh
fi

if test $1 == "-v"
then
bash $CPN_DIR/src/version.sh
fi

if test $1 == "--version"
then
bash $CPN_DIR/src/version.sh
fi
22 changes: 17 additions & 5 deletions src/update.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
cd $CPN_DIR

PULL=$(git pull)
VERSION=$(cpn -v)

if test $PULL == "Already up to date!"
then
Expand All @@ -9,21 +11,31 @@ then
else
git pull

sudo chmod 733 ../cpn.sh
sudo chmod 733 cpn.sh
sudo chomd 733 ./src/init.sh
sudo chmod 733 ./src/options.sh
sudo chmod 733 ./src/uninstall.sh
sudo chmod 733 ./src/update.sh
sudo chomd 733 ./src/help.sh
sudo chomd 733 ./src/version.sh

cd /usr/bin
sudo rm cpn

sudo cp ../cpn.sh /usr/bin
sudo cp $CPN_DIR/cpn.sh /usr/bin
cd /usr/bin
sudo mv cpn.sh cpn
sudo chmod 777 cpn

echo "Update successfully!"
echo
$CPN_DIR/src/help.sh
NEW_VERSION=$(cpn -v)

if test $VERSION != $NEW_VERSION
echo "Update successfully!"
echo
else
echo "Update error contact support"
echo
fi

bash $CPN_DIR/src/help.sh
fi
1 change: 1 addition & 0 deletions src/version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
echo "1.2.2"

0 comments on commit 90ca849

Please sign in to comment.