Skip to content

Commit ed369c5

Browse files
committed
make cache dir to prevent build failures
Some tools don’t think to `mkdir -p` directories that are usually there. Refs pkgxdev/pantry#4807
1 parent 749e90c commit ed369c5

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

bin/cmd/build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ if (env['GITHUB_TOKEN']) {
121121
env['GH_TOKEN'] = env['GITHUB_TOKEN']
122122
}
123123

124+
config.path.cache.mkdir('p') // we’ve indeed found things to break without this
125+
124126
const proc = new Deno.Command(script.string, {clearEnv: true, env}).spawn()
125127
const rv = await proc.status
126128
if (!rv.success) throw new Error(`${rv.code} ${rv.signal}`)

bin/cmd/test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ if (env['GITHUB_TOKEN']) {
9999
env['GH_TOKEN'] = env['GITHUB_TOKEN']
100100
}
101101

102+
config.path.cache.mkdir('p') // we’ve indeed found things to break without this
103+
102104
const proc = new Deno.Command(script.string, {clearEnv: true, env}).spawn()
103105
const rv = await proc.status
104106
if (!rv.success) throw new Error(`${rv.code} ${rv.signal}`)

projects/version-transformer.com/package.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ build:
88
echo {{version}} > VERSION
99
1010
test:
11-
test $(cat {{prefix}}/VERSION) = {{version}}
11+
- test $(cat {{prefix}}/VERSION) = {{version}}
12+
13+
# test that cache directories are created in our sandbox
14+
- run: touch ~/.cache/foo
15+
if: linux
16+
- run: touch ~/Library/Caches/foo
17+
if: darwin

0 commit comments

Comments
 (0)