current work complete
This commit is contained in:
1
Future-Features/bash-script/blog1
Submodule
1
Future-Features/bash-script/blog1
Submodule
Submodule Future-Features/bash-script/blog1 added at fe915cc005
28
Future-Features/bash-script/deploywebsite.sh
Normal file
28
Future-Features/bash-script/deploywebsite.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "`git status -s`" ]
|
||||
then
|
||||
echo "The working directory is dirty. Please commit any pending changes."
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "Deleting old publication"
|
||||
rm -rf public
|
||||
mkdir public
|
||||
git worktree prune
|
||||
rm -rf .git/worktrees/public/
|
||||
|
||||
echo "Checking out gh-pages branch into public"
|
||||
git worktree add -B gh-pages public upstream/gh-pages
|
||||
|
||||
echo "Removing existing files"
|
||||
rm -rf public/*
|
||||
|
||||
echo "Generating site"
|
||||
hugo
|
||||
|
||||
echo "Updating gh-pages branch"
|
||||
cd public && git add --all && git commit -m "Publishing to gh-pages (publish.sh)"
|
||||
|
||||
#echo "Pushing to github"
|
||||
#git push --all
|
||||
19
Future-Features/bash-script/newrepo.sh
Normal file
19
Future-Features/bash-script/newrepo.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
reponame="$1"
|
||||
GITHUBUSER=$(git config github.user)
|
||||
|
||||
|
||||
|
||||
if [ "$reponame" = "" ]; then
|
||||
read -p "Enter Github Repository Name: " reponame
|
||||
fi
|
||||
mkdir ./$reponame
|
||||
cd $reponame
|
||||
curl -u $2:$3 https://api.github.com/user/repos -d "{\"name\":\"$reponame\"}"
|
||||
|
||||
git init
|
||||
echo "ADD README CONTENT" > README.md
|
||||
git add README.md
|
||||
git commit -m "Starting Out"
|
||||
git remote add origin git@github.com:$2/$reponame.git
|
||||
git push -u origin master
|
||||
4
Future-Features/bash-script/updatewebsite.sh
Normal file
4
Future-Features/bash-script/updatewebsite.sh
Normal file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
git add-commit -m "Update website"
|
||||
git push -u origin master
|
||||
Reference in New Issue
Block a user