script: Fix license symlink and path in new-crate.sh (#33620)
While creating a new crate I realised the License symlink and path are broken. The symlink was broken for LICENSE-GPL. Also the file created in the new crate was not using the expected file name as per the check-license script which was failing due to wrong filename in the new crate. I fixed that as well. Release Notes: - N/A Signed-off-by: Umesh Yadav <git@umesh.dev>
This commit is contained in:
+2
-2
@@ -27,7 +27,7 @@ elif [[ "$LICENSE_FLAG" == *"agpl"* ]]; then
|
|||||||
LICENSE_FILE="LICENSE-AGPL"
|
LICENSE_FILE="LICENSE-AGPL"
|
||||||
else
|
else
|
||||||
LICENSE_MODE="GPL-3.0-or-later"
|
LICENSE_MODE="GPL-3.0-or-later"
|
||||||
LICENSE_FILE="LICENSE"
|
LICENSE_FILE="LICENSE-GPL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! "$CRATE_NAME" =~ ^[a-z0-9_]+$ ]]; then
|
if [[ ! "$CRATE_NAME" =~ ^[a-z0-9_]+$ ]]; then
|
||||||
@@ -39,7 +39,7 @@ CRATE_PATH="crates/$CRATE_NAME"
|
|||||||
mkdir -p "$CRATE_PATH/src"
|
mkdir -p "$CRATE_PATH/src"
|
||||||
|
|
||||||
# Symlink the license
|
# Symlink the license
|
||||||
ln -sf "../../../$LICENSE_FILE" "$CRATE_PATH/LICENSE"
|
ln -sf "../../../$LICENSE_FILE" "$CRATE_PATH/$LICENSE_FILE"
|
||||||
|
|
||||||
CARGO_TOML_TEMPLATE=$(cat << 'EOF'
|
CARGO_TOML_TEMPLATE=$(cat << 'EOF'
|
||||||
[package]
|
[package]
|
||||||
|
|||||||
Reference in New Issue
Block a user