mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 14:58:27 -05:00
Prevent static file name linking from operating on symlinks.
This commit is contained in:
@@ -78,7 +78,7 @@ all: pyx static names $(INIS)
|
||||
|
||||
.PHONY: pyx js css rtl static names clean clean_static all
|
||||
|
||||
$(NAMES): static
|
||||
$(NAMES): $(JSTARGETS) $(CSSTARGETS) $(SPRITES) $(MAINCSS)
|
||||
$(UPDATE_NAMES) $(NAMES) $(NAMED)
|
||||
|
||||
$(JSTARGETS): $(JSSOURCES)
|
||||
|
||||
@@ -27,8 +27,9 @@ def update_static_names(names_file, files, make_links=False):
|
||||
|
||||
base = os.path.dirname(names_file)
|
||||
for path in files:
|
||||
name = os.path.relpath(path, base)
|
||||
names[name] = generate_static_name(name, base)
|
||||
if not os.path.islink(path):
|
||||
name = os.path.relpath(path, base)
|
||||
names[name] = generate_static_name(name, base)
|
||||
|
||||
json_enc = json.JSONEncoder(indent=2, sort_keys=True)
|
||||
open(names_file, "w").write(json_enc.encode(names))
|
||||
|
||||
Reference in New Issue
Block a user