Skip to content

Commit

Permalink
Merge pull request #42 from sebastienrousseau/0.2.460
Browse files Browse the repository at this point in the history
0.2.460
  • Loading branch information
sebastienrousseau authored Oct 16, 2022
2 parents 2a89399 + d1e1626 commit 7085b9e
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 24 deletions.
24 changes: 12 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,32 @@ backup: ## Backup your current dotfiles.

.PHONY: clean
clean: # @HELP
clean: ## Removes any previous setup directories.
clean: ## Removes any previous setup.
clean:
@$(HOMEDIR)/scripts/clean.sh clean

.PHONY: copy
copy: # @HELP Copy the dotfiles on your system.
copy: # @HELP
copy: ## Copy the dotfiles on your system.
@$(HOMEDIR)/scripts/dotfiles copy
@$(HOMEDIR)/scripts/copy.sh copy

.PHONY: download
download: # @HELP Download the dotfiles on your system.
download: # @HELP
download: ## Download the dotfiles on your system.
@$(HOMEDIR)/scripts/dotfiles download
@$(HOMEDIR)/scripts/download.sh download

.PHONY: assemble
assemble: # @HELP Assemble the dotfiles on your system.
assemble: ## Run the full installation process.
@$(HOMEDIR)/scripts/dotfiles assemble
.PHONY: build
build: # @HELP
build: ## Run the full installation process.
@$(HOMEDIR)/scripts/build.sh build

.PHONY: unpack
unpack: # @HELP Unpack the dotfiles on your system.
unpack: # @HELP
unpack: ## Extract the dotfiles to your system.
@$(HOMEDIR)/scripts/dotfiles unpack
@$(HOMEDIR)/scripts/unpack.sh unpack

.PHONY: help
help: # @HELP Display the help menu.
help: # @HELP
help: ## Display the help menu.
@$(BANNER)
@awk 'BEGIN {FS = ":.*##"; printf "\USAGE:\n\n make \033[1;96m[COMMAND]\033[0m\n\nCOMMANDS:\n\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[1;96m%-8s\033[0m -%s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Expand Down
6 changes: 4 additions & 2 deletions lib/configurations/default/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
# License: MIT

## 🅳🅾🆃🅵🅸🅻🅴🆂 🆅🅰🆁🅸🅰🅱🅻🅴🆂 - Set Dotfiles variables.
# DF_CURRENT_DIR=${PWD} # Current directory.
# DF_CURRENT_DIR=${PWD} # Current directory.
DF=".dotfiles/" # Dotfiles.
DF_DIR="${HOME}/.dotfiles/" # Dotfiles directory.
DF_BACKUPDIR="${HOME}/dotfiles_backup" # Backup directory.
DF_BACKUPDIR="${HOME}/dotfiles_backup/" # Backup directory.
DF_DOWNLOADDIR="${HOME}/Downloads" # Download directory.
DF_VERSION="0.2.459" # Dotfiles Version number.
DF_TIMESTAMP="$(date +%Y-%m-%d_%H-%M-%S)" # Timestamp for backup directory.

export DF
export DF_BACKUPDIR
export DF_DIR
export DF_DOWNLOADDIR
Expand Down
9 changes: 7 additions & 2 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,14 @@ backup() {

# Backup existing Dotfiles directory.
if [[ -d "${HOME}"/.dotfiles ]]; then
echo "${GREEN}${NC} Backing up previous Dotfiles installation to '${GREEN}${DF_BACKUPDIR}/${DF_TIMESTAMP}/${NC}'..."
echo "${GREEN}${NC} Backing up previous Dotfiles installation to '${GREEN}${DF_BACKUPDIR}${DF_TIMESTAMP}/${NC}'..."
# shellcheck disable=SC2154
mv -f "${DF_DOTFILESDIR}" "${HOME}"/dotfiles_backup/"${DF_TIMESTAMP}"/
if [[ -d "${DF_BACKUPDIR}${DF_TIMESTAMP}/${DF}" ]]; then
mv -f "${DF_DOTFILESDIR}" "${DF_BACKUPDIR}${DF_TIMESTAMP}/${DF}"
else
mkdir -p "${DF_BACKUPDIR}${DF_TIMESTAMP}/${DF}"
mv -f "${DF_DOTFILESDIR}" "${DF_BACKUPDIR}${DF_TIMESTAMP}/${DF}"
fi
fi

# File list (use trailing slash for directories)
Expand Down
11 changes: 9 additions & 2 deletions scripts/assemble.sh → scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
# shellcheck disable=SC1091
. "./scripts/copy.sh"

## 🅰🆂🆂🅴🅼🅱🅻🅴 - Assemble the dotfiles on your system.
assemble() {
## 🅱🆄🅸🅻🅳 - Build the dotfiles on your system.
build() {

# shellcheck disable=SC2154
echo "${RED}${NC} Preparing the dotfiles on your system."
Expand All @@ -30,3 +30,10 @@ assemble() {
copy

}

args=$* # Arguments passed to script.
export args="${args}" # Exporting arguments.
if [[ ${args} = "build" ]]; then
echo "$*"
build
fi
2 changes: 1 addition & 1 deletion scripts/copy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ copy() {
echo "${GREEN}${NC} Copying '${YELLOW}.gemrc${NC}'" &&

# inputrc -- Copying .inputrc file.
cp -f "${PWD}"/lib/configurations/inputrc/inputrc "${HOME}"/.inputrc &&
cp -f "${PWD}"/lib/configurations/input/inputrc "${HOME}"/.inputrc &&
echo "${GREEN}${NC} Copying '${YELLOW}.inputrc${NC}'" &&

# jshintrc -- Copying .jshintrc file.
Expand Down
16 changes: 13 additions & 3 deletions scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,21 @@ export DF_DOTFILESDIR # Exporting Location of dotfiles.
## 🅳🅾🆆🅽🅻🅾🅰🅳 - Download the dotfiles on your system.
download() {
# shellcheck disable=SC2154
echo "${RED}${NC} Downloading ${GREEN}Dotfiles v${DF_VERSION}${NC} on your system."
echo "${RED}${NC} Downloading ${GREEN}Dotfiles v${DF_VERSION}${NC} on your system at ${GREEN}${DF_DOWNLOADDIR}${NC}..."

# Download the dotfiles with curl.
# shellcheck disable=SC2154
# wget https://github.com/sebastienrousseau/dotfiles/archive/refs/tags/v"${DF_VERSION}".zip -N -O "${DF_DOWNLOADDIR}/v${DF_VERSION}.zip"
# curl -0 https://github.com/sebastienrousseau/dotfiles/archive/refs/tags/v"${DF_VERSION}".tar.gz -o "${DF_DOWNLOADDIR}"/dotfiles-"${DF_VERSION}".tar.gz

# Download the dotfiles with wget.
# shellcheck disable=SC2154
curl https://github.com/sebastienrousseau/dotfiles/archive/refs/tags/v"${DF_VERSION}".zip -o "${DF_DOWNLOADDIR}"/v"${DF_VERSION}".zip
wget --no-check-certificate --content-disposition https://github.com/sebastienrousseau/dotfiles/archive/refs/tags/v"${DF_VERSION}".zip -O "${DF_DOWNLOADDIR}/v${DF_VERSION}.zip"

}

args=$* # Arguments passed to script.
export args="${args}" # Exporting arguments.
if [[ ${args} = "download" ]]; then
echo "$*"
download
fi
4 changes: 2 additions & 2 deletions scripts/help.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ USAGE:
COMMANDS:
$(echo -e "\033[1;96mbackup\033[0m\n") - Backup your current dotfiles.
$(echo -e "\033[1;96mclean\033[0m\n") - Removes any previous setup directories.
$(echo -e "\033[1;96mclean\033[0m\n") - Removes any previous setup.
$(echo -e "\033[1;96mcopy\033[0m\n") - Copy the dotfiles on your system.
$(echo -e "\033[1;96mdownload\033[0m\n") - Download the dotfiles on your system.
$(echo -e "\033[1;96massemble\033[0m\n") - Run the full installation process.
$(echo -e "\033[1;96mbuild\033[0m\n") - Run the full installation process.
$(echo -e "\033[1;96munpack\033[0m\n") - Extract the dotfiles to your system.
$(echo -e "\033[1;96mhelp\033[0m\n") - Display the help menu.
Expand Down

0 comments on commit 7085b9e

Please sign in to comment.