-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprivate.ss
More file actions
34 lines (28 loc) · 790 Bytes
/
private.ss
File metadata and controls
34 lines (28 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
```code
* Update /private gists *
* Usage: x run private.ss <id>? *
{{
{
'northwind': 'dc49cbcf6178033500c19b80f2ec8c3a',
}
|> to => gistMap
}}
var optional = []
var ignore = []
var keys = ARGV.Length > 0 ? ARGV : gistMap.Keys
#each id in keys
var gistId = gistMap[id]
var files = {}
var fs = vfsFileSystem(`private/${id}`)
#each file in fs.allFiles()
var key = file.VirtualPath.replace('/','\\')
key = optional.contains(key) ? `${key}?` : key
#if !ignore.contains(key)
files.putItem(key, file.fileContents()) |> end
/if
/each
`Writing to ${files.count()} files to ${id} ${gistId} ...`
var gist = vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable())
gist.writeFiles(files)
/each
```