Skip to content

Commit

Permalink
Add new schema from ScoopInstaller#3212 with small tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
niheaven committed Mar 13, 2019
1 parent f974052 commit f9423d8
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1185,10 +1185,10 @@ function persist_data($manifest, $original_dir, $persist_dir) {
# create link
if (is_directory $target) {
# target is a directory, create junction
create_junction $target $source | Out-Null
create_junction $source $target | Out-Null
} else {
# target is a file, create hard link
create_hardlink $target $source | Out-Null
create_hardlink $source $target | Out-Null
}
}
}
Expand Down
65 changes: 64 additions & 1 deletion schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,69 @@
},
"type": "object"
},
"persist": {
"anyOf": [
{
"description": "Deprecated, use object representation instead.",
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
},
{
"items": {
"type": "object",
"additionalProperties": false,
"required": [
"name",
"type"
],
"properties": {
"name": {
"type": "string"
},
"target": {
"type": "string"
},
"type": {
"enum": [
"file",
"directory"
]
},
"encoding": {
"enum": [
"ASCII",
"BigEndianUnicode",
"BigEndianUTF32",
"Byte",
"Default",
"OEM",
"Unicode",
"UTF7",
"UTF8",
"UTF32"
]
},
"content": {
"$ref": "#/definitions/stringOrArrayOfStrings"
},
"glue": {
"description": "Characters to join content array",
"type": "string"
},
"method": {
"enum": [
"link",
"copy",
"merge",
"update"
]
}
}
},
"minItems": 1,
"type": "array"
}
]
},
"checkver": {
"anyOf": [
{
Expand Down Expand Up @@ -407,7 +470,7 @@
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
},
"persist": {
"$ref": "#/definitions/stringOrArrayOfStringsOrAnArrayOfArrayOfStrings"
"$ref": "#/definitions/persist"
},
"checkver": {
"$ref": "#/definitions/checkver"
Expand Down

0 comments on commit f9423d8

Please sign in to comment.