vimPlugins: Store deprecation date.
This commit is contained in:
parent
7cc024b59e
commit
25fea4538e
|
@ -31,8 +31,8 @@ let
|
||||||
(checkInPkgs n alias)))
|
(checkInPkgs n alias)))
|
||||||
aliases;
|
aliases;
|
||||||
|
|
||||||
deprecations = lib.mapAttrs (old: new:
|
deprecations = lib.mapAttrs (old: info:
|
||||||
throw "${old} was renamed to ${new}. Please update to ${new}."
|
throw "${old} was renamed to ${info.new} on ${info.date}. Please update to ${info.new}."
|
||||||
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
|
) (builtins.fromJSON (builtins.readFile ./deprecated.json));
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,6 +1,18 @@
|
||||||
{
|
{
|
||||||
"gist-vim": "vim-gist",
|
"gist-vim": {
|
||||||
"vim-jade": "vim-pug",
|
"date": "2020-03-27",
|
||||||
"vundle": "Vundle.vim",
|
"new": "vim-gist"
|
||||||
"youcompleteme": "YouCompleteMe"
|
},
|
||||||
|
"vim-jade": {
|
||||||
|
"date": "2020-03-27",
|
||||||
|
"new": "vim-pug"
|
||||||
|
},
|
||||||
|
"vundle": {
|
||||||
|
"date": "2020-03-27",
|
||||||
|
"new": "Vundle.vim"
|
||||||
|
},
|
||||||
|
"youcompleteme": {
|
||||||
|
"date": "2020-03-27",
|
||||||
|
"new": "YouCompleteMe"
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -420,13 +420,17 @@ def rewrite_input(input_file: Path, output_file: Path, redirects: dict):
|
||||||
if redirects:
|
if redirects:
|
||||||
lines = [redirects.get(line, line) for line in lines]
|
lines = [redirects.get(line, line) for line in lines]
|
||||||
|
|
||||||
|
cur_date_iso = datetime.now().strftime("%Y-%m-%d")
|
||||||
with open(DEPRECATED, "r") as f:
|
with open(DEPRECATED, "r") as f:
|
||||||
deprecations = json.load(f)
|
deprecations = json.load(f)
|
||||||
for old, new in redirects.items():
|
for old, new in redirects.items():
|
||||||
old_name = old.split("/")[1].split(" ")[0].strip("\n")
|
old_name = old.split("/")[1].split(" ")[0].strip("\n")
|
||||||
new_name = new.split("/")[1].split(" ")[0].strip("\n")
|
new_name = new.split("/")[1].split(" ")[0].strip("\n")
|
||||||
if old_name != new_name:
|
if old_name != new_name:
|
||||||
deprecations[old_name] = new_name
|
deprecations[old_name] = {
|
||||||
|
"new": new_name,
|
||||||
|
"date": cur_date_iso,
|
||||||
|
}
|
||||||
with open(DEPRECATED, "w") as f:
|
with open(DEPRECATED, "w") as f:
|
||||||
json.dump(deprecations, f, indent=4, sort_keys=True)
|
json.dump(deprecations, f, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue