File tree Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Expand file tree Collapse file tree 1 file changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -56,26 +56,37 @@ first_class() {
56
56
head -n 1
57
57
}
58
58
59
- for file in " $@ "
59
+ for arg in " $@ "
60
60
do
61
- case " $file " in
61
+ case " $arg " in
62
+ * :* :* )
63
+ ga=${arg%:* }
64
+ g=${ga%%:* }
65
+ a=${ga#*: }
66
+ v=${arg##*: }
67
+ f=" $HOME /.m2/repository/$( echo " $g " | tr ' .' ' /' ) /$a /$v /$a -$v .jar"
68
+ test -f " $f " || mvn dependency:get -D" $arg "
69
+ arg=" $f "
70
+ ;;
71
+ esac
72
+ case " $arg " in
62
73
* .class)
63
- version=$( cat " $file " | class_version)
74
+ version=$( cat " $arg " | class_version)
64
75
;;
65
76
* .jar)
66
- class=$( first_class " $file " )
77
+ class=$( first_class " $arg " )
67
78
if [ -z " $class " ]
68
79
then
69
- echo " $file : No classes"
80
+ echo " $arg : No classes"
70
81
continue
71
82
fi
72
- version=$( unzip -p " $file " " $class " | class_version)
83
+ version=$( unzip -p " $arg " " $class " | class_version)
73
84
;;
74
85
* )
75
- >&2 echo " Unsupported file : $file "
86
+ >&2 echo " Unsupported argument : $arg "
76
87
continue
77
88
esac
78
89
79
90
# report the results
80
- echo " $file : $version "
91
+ echo " $arg : $version "
81
92
done
You can’t perform that action at this time.
0 commit comments