mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-15 00:34:51 -05:00
* Rewrite static assets only if needed
Refactor UpdateAssetsSubpathInDir so that the actual rewriting of files
happen in two different functions: one for root.html, another for
manifest.json and *.css files.
I would have wanted to simply do a
if pathToReplace == newPath { return nil }
when those two variables are defined, but the logic for root.html is not
that simple, and that may miss some edge cases, so I opted out for
simply moving the actual rewriting to individual functions, which check
for their corresponding conditions to perform the update:
1. for root.html, check that the edited file is indeed different than
the original one
2. for manifest.json and *.css files, rewrite them only if
pathToReplace != newPath, which in this case is clear that that's the
only modification we do
* Fix expected error msg in test
---------
Co-authored-by: Mattermost Build <build@mattermost.com>
|
||
|---|---|---|
| .. | ||
| fileutils | ||
| imgutils | ||
| mocks | ||
| testutils | ||
| api.go | ||
| api_test.go | ||
| archive.go | ||
| archive_test.go | ||
| backoff.go | ||
| backoff_test.go | ||
| emoji.go | ||
| file.go | ||
| file_test.go | ||
| hash.go | ||
| humanize.go | ||
| i18n.go | ||
| license-public-key-test.txt | ||
| license-public-key.txt | ||
| license.go | ||
| license_public_key.go | ||
| license_test.go | ||
| markdown.go | ||
| markdown_test.go | ||
| merge.go | ||
| merge_test.go | ||
| policies-roles-mapping.json | ||
| random.go | ||
| subpath.go | ||
| subpath_test.go | ||
| textgeneration.go | ||
| time.go | ||
| time_test.go | ||
| urlencode.go | ||
| urlencode_test.go | ||
| utils.go | ||
| utils_test.go | ||