0
0
mirror of https://github.com/nextcloud/server.git synced 2024-10-18 00:06:34 +00:00
nextcloud_server/build/npm-post-build.sh
Joas Schilling bcbef7aaa8
Update build/npm-post-build.sh
Signed-off-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
2024-06-14 08:53:02 +02:00

30 lines
741 B
Bash
Executable File

#!/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 source map
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