Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Repository initializer

A small Nushell initializer for bootstrapping a repository from the folder tree in repository-template/.

The script stages the source tree in a temporary directory, then walks repository-template/ with an interactive TUI.

Requirements

  • mise
  • curl
  • git

Usage

(
  # Setup deps
  D=$(mktemp -d)
  trap 'mise untrust "${D}/.mise.toml" 2>/dev/null; rm -rf "${D}"; mise prune -y -q' EXIT
  curl -fsSL https://raw.githubusercontent.com/aguimbao/repository-template/main/.mise.toml -o "${D}/.mise.toml"
  mise trust "${D}/.mise.toml"
  mise install -C "${D}"
  eval "$(mise env -C "${D}" -s bash)"

  # Runs the nushell script
  nu -c "$(curl -fsSL https://raw.githubusercontent.com/aguimbao/repository-template/main/init.nu)"
)

The fetched script clones this repository into a temporary directory, walks its repository-template/ tree, and removes the temporary directory when the script exits.

Template tree

Every directory is a node. commands and templates are reserved directories:

repository-template/
└── vcs/
    ├── commands/
    ├── templates/
    ├── git/
    │   ├── commands/
    │   └── templates/
    └── jj/
        ├── commands/
        └── templates/

The TUI walks this tree recursively. Files under templates/ are copied to the destination, preserving their path relative to that directory. Files under commands/ are Nushell command files; their contents are shown before they are run in the destination directory.

A node may contain direct actions, child nodes, or both. The same traversal is used at every level.

About

Repository templates

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages