mirror of
https://github.com/nextcloud/server.git
synced 2026-04-02 15:45:38 -04:00
chore: Adjust post-build script to add license files for sourcemaps on build
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
be29eb3641
commit
daa1646b3d
2 changed files with 30 additions and 1 deletions
29
build/npm-post-build.sh
Executable file
29
build/npm-post-build.sh
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
|
||||
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
set -e
|
||||
|
||||
# Build CSS files from SCSS
|
||||
npm run sass
|
||||
# Build icons
|
||||
npm run sass:icons
|
||||
|
||||
# Add licenses for source maps
|
||||
if [ -d "dist" ]; then
|
||||
for f in dist/*.js; do
|
||||
# If license file and source map exists copy license for the sourcemap
|
||||
if [ -f "$f.license" ] && [ -f "$f.map" ]; then
|
||||
# Remove existing link
|
||||
[ -e "$f.map.license" ] || [ -L "$f.map.license" ] && rm "$f.map.license"
|
||||
# Create a new link
|
||||
ln -s "$(basename "$f.license")" "$f.map.license"
|
||||
fi
|
||||
done
|
||||
echo "Copying licenses for sourcemaps done"
|
||||
else
|
||||
echo "This script needs to be executed from the root of the repository"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
},
|
||||
"scripts": {
|
||||
"build": "webpack --node-env production --progress",
|
||||
"postbuild": "npm run sass && npm run sass:icons",
|
||||
"postbuild": "build/npm-post-build.sh",
|
||||
"dev": "webpack --node-env development --progress",
|
||||
"watch": "webpack --node-env development --progress --watch",
|
||||
"lint": "eslint $(for appdir in $(ls apps); do if ! $(git check-ignore -q $appdir); then printf \"$appdir \"; fi; done) core --no-error-on-unmatched-pattern",
|
||||
|
|
|
|||
Loading…
Reference in a new issue