Skip to content

Commit

Permalink
treewide: revise module install data filename
Browse files Browse the repository at this point in the history
  • Loading branch information
nullxception committed Mar 26, 2021
1 parent 9ee87c8 commit a18f917
Show file tree
Hide file tree
Showing 19 changed files with 11 additions and 11 deletions.
File renamed without changes.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,24 @@ and that's pretty much it 😊
## 📑 Topic Structures
As you can see, this dotfiles is grouped by topics.

Each of it has their own `.moduleinst` files that will be used by `install.sh`. Here's some methods that currently supported by the `install.sh`.
Each of it has their own `.module-data.bash` files that will be used by `install.sh`. Here's some methods that currently supported by the `install.sh`.

* **basic copy-to-target**

For simple structures like the `audio` topic, `install.sh` will deploy all the files inside `audio` topic into `$HOME/.config/`, which's already defined in `audio/.moduleinst` by `module_target` variable.
For simple structures like the `audio` topic, `install.sh` will deploy all the files inside `audio` topic into `$HOME/.config/`, which's already defined in `audio/.module-data.bash` by `module_target` variable.

* **custom install method**

For another topics that needs dynamic operation like `firefox`, `install.sh` will using `module_install()` function that already defined in `firefox/.moduleinst`.
For another topics that needs dynamic operation like `firefox`, `install.sh` will using `module_install()` function that already defined in `firefox/.module-data.bash`.

* **dynamic destination**

Since `.moduleinst` are just merely a bash script that will be evaluated by `install.sh`, we can also utilize the power of shell script to extends it.
Since `.module-data.bash` are just merely a bash script that will be evaluated by `install.sh`, we can also utilize the power of shell script to extends it.
For example, `vscode` topic has a simple prompt to choose the install destination.

* or, **No install method at all.**

There's an another topic that has no `.moduleinst` file, the `script` topic.
There's an another topic that has no `.module-data.bash` file, the `script` topic.

Unlike `bin`, this topic are only meant to store executable scripts, portably, no need to be installed on anywhere.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param(
[String] $Module
)
$DotfilesPath = Split-Path -parent $PSCommandPath
$ModuleData = ".modinstall.ps1"
$ModuleData = ".module-data.ps1"

function Install-Mod($Name) {
$ModuleName = Split-Path $Name -Leaf
Expand Down
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ deploy_topic() {
fi

find "$moddir" -type f | while read src; do
[ "${src#*.moduleinst}" != "$src" ] && continue
[ "${src#*.module-data.bash}" != "$src" ] && continue

dest="$(printf ${src%/*} | sed "s|$moddir|$target|")/"
log "copying $src to $dest"
Expand All @@ -66,12 +66,12 @@ install_mod() {
local comm_prefix=""
local mod=$(basename "$(realpath "$1")")

if [[ ! -f "$dotfiles/$1/.moduleinst" ]]; then
log ".moduleinst for \"$1\" doesn't exists. aborting"
if [[ ! -f "$dotfiles/$1/.module-data.bash" ]]; then
log ".module-data.bash for \"$1\" doesn't exists. aborting"
exit 1
fi

source "$dotfiles/$mod/.moduleinst"
source "$dotfiles/$mod/.module-data.bash"
if fun_exists module_preinstall; then
module_preinstall
fi
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion vscode/.modinstall.ps1

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions vscode/.module-data.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$InstallTarget = "$env:APPDATA\Code\User"
File renamed without changes.

0 comments on commit a18f917

Please sign in to comment.