Merge branch 'v3' into v3-t85
This commit is contained in:
+6
-15
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env nu
|
||||
# Build independent commands and a committed source snapshot of their repository.
|
||||
# Build independent commands and plain source files. World creation initializes their repository.
|
||||
def main [destination?: path] {
|
||||
let here = $env.FILE_PWD
|
||||
let destination = ($destination | default ($here | path join .. target userland bundle) | path expand)
|
||||
@@ -47,27 +47,18 @@ def main [destination?: path] {
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'chat unit copy failed'} }
|
||||
'' | save --force ($units | path join multi-user.target.wants chat.service)
|
||||
let repo = ($here | path join .. | path expand)
|
||||
let revision = (^git -C $repo rev-parse HEAD | str trim)
|
||||
let snapshot = ($destination | path join src sausage)
|
||||
if ($snapshot | path exists) { rm --recursive --force $snapshot }
|
||||
mkdir $snapshot
|
||||
let archive = ($destination | path join source.tar)
|
||||
^git -C $repo archive --output $archive HEAD host vfs userland agents skills extensions Cargo.toml Cargo.lock flake.nix flake.lock README.md AGENTS.md .gitignore
|
||||
^git -C $repo archive --output $archive HEAD host vfs userland config skills extensions Cargo.toml Cargo.lock flake.nix flake.lock README.md AGENTS.md .gitignore
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source archive failed'} }
|
||||
^tar -xf $archive -C $snapshot
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source extraction failed'} }
|
||||
rm $archive
|
||||
^git -C $snapshot init --quiet --initial-branch=main
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source git init failed'} }
|
||||
^git -C $snapshot add host vfs userland agents skills extensions Cargo.toml Cargo.lock flake.nix flake.lock README.md AGENTS.md .gitignore
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source git add failed'} }
|
||||
with-env {
|
||||
GIT_AUTHOR_NAME: 'Sausage', GIT_AUTHOR_EMAIL: 'sausage@localhost',
|
||||
GIT_COMMITTER_NAME: 'Sausage', GIT_COMMITTER_EMAIL: 'sausage@localhost',
|
||||
GIT_AUTHOR_DATE: '2000-01-01T00:00:00+0000', GIT_COMMITTER_DATE: '2000-01-01T00:00:00+0000'
|
||||
} {
|
||||
^git -C $snapshot commit --no-gpg-sign --quiet -m $'Bundle source ($revision)'
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'source git commit failed'} }
|
||||
}
|
||||
let settings = ($destination | path join etc sausage)
|
||||
mkdir $settings
|
||||
^cp --remove-destination ($snapshot | path join config config.yaml) ($settings | path join config.yaml)
|
||||
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'default config copy failed'} }
|
||||
print $destination
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user