Skip to content

Instantly share code, notes, and snippets.

@pepicrft
Last active January 12, 2025 05:04
Show Gist options
  • Save pepicrft/12a2fc6433338489888d660d66d8d0b1 to your computer and use it in GitHub Desktop.
Save pepicrft/12a2fc6433338489888d660d66d8d0b1 to your computer and use it in GitHub Desktop.
A script that creates a Mise reproducible project
#!/usr/bin/env bash
PROJECT_DIR="./project"
# Create the Mise reproduce task
mkdir -p "$PROJECT_DIR/.mise/tasks"
cat << 'EOF' > "$PROJECT_DIR/.mise/tasks/reproduce.sh"
#!/usr/bin/env bash
# mise description = "Reproduce the project"
# Mise tasks: https://mise.jdx.dev/tasks/file-tasks.html
# Note the root directory is denoted by the env. variable $MISE_PROJECT_ROOT
# Your reproduction steps go here
EOF
chmod +x "$PROJECT_DIR/.mise/tasks/reproduce.sh"
# Create the .mise.toml file with the specified content
cat << 'EOF' > "$PROJECT_DIR/.mise.toml"
[tools]
# Add your tools here
[hooks]
enter = "mise install"
EOF
mise trust "$PROJECT_DIR/.mise.toml"
echo "Mise task and configuration files have been created in the ./project directory."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment