#!/usr/bin/env nu # SPDX-License-Identifier: AGPL-3.0-only # SPDX-FileCopyrightText: 2025 @matrixfurry.com use std log const common = path self ../../ def main [ --update-license --commit (-c) ] { if $commit and (jj status | lines | first) != "The working copy has no changes." { error make { msg: "the working copy has changes" help: "create an empty commit before updating files" } } cp -r ($common | path join docs) . log info "updated common project files" if $update_license or not ("./LICENSE" | path exists) { cp -r ($common | path join LICENSE) . log warning "updated project license" } if $commit { jj commit -m "docs: update shared documentation" } }