We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b195f58 commit 474553bCopy full SHA for 474553b
scripts/is_contract.sh
@@ -34,7 +34,14 @@ SOURCE_PATH=$(cargo metadata --format-version=1 --manifest-path "$MANIFEST_PATH"
34
| select(.id == $ROOT_PACKAGE).targets[]
35
| select(.kind[] | contains("lib")).src_path')
36
37
-if grep -q '^#\[ink::contract\([^]]*\)\]' $SOURCE_PATH; then
+# Check if SOURCE_PATH is empty
38
+if [ -z "$SOURCE_PATH" ]; then
39
+ echo "Error: Source path is empty."
40
+ exit 1
41
+fi
42
+
43
+# Check for the #[ink::contract] macro in the source file
44
+if grep -q '^#\[ink::contract\([^]]*\)\]' "$SOURCE_PATH"; then
45
exit 0
46
else
47
exit 1
0 commit comments