-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfiles.ss
More file actions
31 lines (26 loc) · 798 Bytes
/
files.ss
File metadata and controls
31 lines (26 loc) · 798 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
```code
* Update /files gists *
* Usage: x run files.ss <id>? *
{{
{
'bcl.proto': '33232feeeb4f7d2043d27afb1d60259b',
'gen-https.sh': '4b321ee5258d5c7d8c634610aabb5af1',
}
|> to => gistMap
}}
var optional = []
var keys = ARGV.Length > 0 ? ARGV : gistMap.Keys
#each id in keys
var gistId = gistMap[id]
var textFiles = {}
var fs = vfsFileSystem(`files/${id}`)
#each file in fs.allFiles()
var key = file.VirtualPath.replace('/','\\')
key = optional.contains(key) ? `${key}?` : key
textFiles.putItem(key, file.textContents()) |> end
/each
`Writing to ${textFiles.count()} files to ${id} ${gistId} ...`
var gist = vfsGist(gistId, 'GISTLYN_TOKEN'.envVariable())
gist.writeTextFiles(textFiles)
/each
```