From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- devtools/shared/commands/create-command.sh | 129 +++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100755 devtools/shared/commands/create-command.sh (limited to 'devtools/shared/commands/create-command.sh') diff --git a/devtools/shared/commands/create-command.sh b/devtools/shared/commands/create-command.sh new file mode 100755 index 0000000000..1f95f96df6 --- /dev/null +++ b/devtools/shared/commands/create-command.sh @@ -0,0 +1,129 @@ +#!/bin/bash + +# Script to easily create a new command, including: +# - a template for the main command file +# - test folder and test head.js file +# - a template for a first test +# - all necessary build manifests + +if [[ -z $1 || -z $2 ]]; then + echo "$0 expects two arguments:" + echo "$(basename $0) command-file-name CommandName" + echo " 1) The file name for the command, with '-' as separators between words" + echo " This will be the name of the folder" + echo " 2) The command name being caml cased" + echo " This will be used to craft the name of the JavaScript class" + exit +fi + +if [ -e $1 ]; then + echo "$1 already exists. Please use a new folder/command name." +fi + +CMD_FOLDER=$1 +CMD_FILE_NAME=$1-command.js +CMD_NAME=$2Command + +pushd `dirname $0` + +echo "Creating a new command called '$CMD_NAME' in $CMD_FOLDER" + +mkdir $CMD_FOLDER + +cat > $CMD_FOLDER/moz.build < $CMD_FOLDER/$CMD_FILE_NAME < $CMD_FOLDER/tests/browser.toml < $CMD_FOLDER/tests/head.js < $CMD_FOLDER/tests/browser_$1.js <