Skip to content

Improve shebang compatability and quote file paths #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addRemoteOrigin.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
clear
echo "-------- Add remote origin for all directories --------------"

Expand Down Expand Up @@ -27,9 +27,9 @@ ORGANIZATION="mdn"
for i in "${repositories[@]}"
do
echo "git remote add upstream https://github.com/${ORGANIZATION}/$i.git"
cd ${SYSTEM_DIR}/$i
cd "${SYSTEM_DIR}/$i"
git branch
git remote add upstream https://github.com/${ORGANIZATION}/$i.git
git remote add upstream "https://github.com/${ORGANIZATION}/$i.git"
done


Expand Down
12 changes: 6 additions & 6 deletions createDIRwithMD.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# START ----------------------------
#
Expand Down Expand Up @@ -26,7 +26,7 @@ goToCorrectDirectory () {

path="${SYSTEM_DIR}${REPO_PATH}${sub_path}"

cd ${path}
cd "${path}"
echo "Selected Directory:"
pwd
echo "Is that correct? (y/n/x for exit)"
Expand All @@ -50,9 +50,9 @@ createDocuments () {
echo "Sorry, that folder already exists. Try again."
createDocuments
else
mkdir ${newFileName}
mkdir "${newFileName}"
# create an index.md in that folder
touch ${newFileName}/index.md
touch "${newFileName}/index.md"
addContent
fi
# Ask user to enter a new folder name or exit?
Expand Down Expand Up @@ -82,7 +82,7 @@ addContent () {
export usefulFileName=${newFileName//_/ }
export sectionTitle=(${words[${length}-2]//_// })

cat > ${newFileName}/index.md <<- EOM
cat > "${newFileName}/index.md" <<- EOM
---
title: '${sectionTitle}: ${usefulFileName}'
slug: Web${sub_path}/${newFileName}
Expand All @@ -109,4 +109,4 @@ goToCorrectDirectory
echo "We're in the right directory. Now let's create the files"

# then create the folders and index files
createDocuments
createDocuments
2 changes: 1 addition & 1 deletion pushCurrentAndBase.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

# run after fetching upstream
# ~/scripts/startFresh.sh
Expand Down
4 changes: 2 additions & 2 deletions startFresh.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
clear
echo "-------- Update all repos! --------------"

Expand All @@ -25,7 +25,7 @@ path=''
for i in "${repositories[@]}"
do
path="${SYSTEM_DIR}/$i"
cd ${path}
cd "${path}"

#content has different origing
if [[ i == content ]]
Expand Down
6 changes: 3 additions & 3 deletions upstreamAllRepos.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
clear
echo "-------- Update all repos! --------------"

Expand Down Expand Up @@ -34,7 +34,7 @@ path=''
for i in "${repositories[@]}"
do
path="${SYSTEM_DIR}/$i"
cd ${path}
cd "${path}"

#check if the repo has a default 'main branch'
if [[ ${mainBranch[*]} =~ $i ]]
Expand All @@ -53,4 +53,4 @@ for i in "${repositories[@]}"
done

# if you like your computer to talk to you
# say "Mission Accomplished"
# say "Mission Accomplished"