Skip to content

Commit

Permalink
add after_setup.host
Browse files Browse the repository at this point in the history
  • Loading branch information
kla committed Nov 30, 2024
1 parent 3f49bb2 commit 78d7543
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,16 @@ export default class Container {
}

async runHook(type) {
let hook = this.labels[`stax.${type}`]
if (!hook) return

if (existsSync(hook))
run(`cat ${hook} | docker container exec --interactive ${this.containerName} /bin/sh`)
else
run(hook)
[ '', '.host' ].forEach((location) => {
let hook = this.labels[`stax.${type}${location}`]
if (!hook) return

if (existsSync(hook)) {
const command = location === '.host' ? hook : `cat ${hook} | docker container exec --interactive ${this.containerName} /bin/sh`
run(command)
} else
run(hook)
})
}

async copy(source: string, destination: string, options: { dontOverwrite?: boolean } = {}) {
Expand Down

0 comments on commit 78d7543

Please sign in to comment.