meonkeys commented on code in PR #6340:
URL: https://github.com/apache/fineract/pull/6340#discussion_r3971333539


##########
scripts/check-dependency-licenses.sh:
##########
@@ -0,0 +1,278 @@
+#!/bin/bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Usage: ./scripts/check-dependency-licenses.sh [--base-sha <sha>] 
[--check-jar] [--help]
+set -e
+
+BASE_SHA=""
+CHECK_JAR=""
+CLEANUP_WORKTREE=""
+FAILED=0
+RELEASE_PROJECT=":fineract-provider"
+RELEASE_MODULE_DIR="fineract-provider"
+
+show_help() {
+    cat << 'EOF'
+Usage: ./scripts/check-dependency-licenses.sh [OPTIONS]
+
+Options:
+  --base-sha <sha>   Base SHA or ref to compare against (e.g. origin/develop).

Review Comment:
   an invalid reference here (e.g. `oi32noinfweoinf3oi23no23n23`) is ignored. 
I'd rather it crashes the script with a descriptive message.
   
   I suggest verifying the arg to `--base-sha` with something like
   
   ```bash
   git rev-parse --verify --quiet "$BASE_SHA"^{commit}
   ```
   
   "Reference" is more general and the arg accepts branches, commit SHAs, tags, 
etc. so I'd use the placeholder `<ref>` and the var name `BASE_REF`, too, so 
`--base-ref <ref>   Base SHA or ref to compare against...` and
   
   ```bash
   git rev-parse --verify --quiet "$BASE_REF"^{commit}
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to