ic-mops 0.43.0 → 0.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/cli.tgz CHANGED
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.42.1",
3
+ "version": "0.44.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "bin/mops.js",
@@ -1,3 +1,39 @@
1
1
  #!/bin/bash
2
- mocPath="$(mops toolchain bin moc --fallback)"
3
- $mocPath "$@"
2
+
3
+ # set -e
4
+
5
+ findRootDir() {
6
+ dir="$(pwd)"
7
+ while [[ "$dir" != "" && ! -e "$dir/mops.toml" ]]; do
8
+ dir=${dir%/*}
9
+ done
10
+ echo "$dir"
11
+ }
12
+
13
+ rootDir=$(findRootDir)
14
+ mopsToml="$rootDir/mops.toml"
15
+
16
+ if [[ $rootDir == "" ]] || [[ ! -f $mopsToml ]]; then
17
+ mocPath="$(mops toolchain bin moc --fallback)"
18
+ else
19
+ if command -v openssl &> /dev/null; then
20
+ mopsTomlHash=$(openssl sha256 $mopsToml | awk -F'= ' '{print $2}')
21
+ else
22
+ mopsTomlHash=$(shasum $mopsToml -a 256 | awk -F' ' '{print $1}')
23
+ fi;
24
+
25
+ cached="$rootDir/.mops/moc-$mopsTomlHash"
26
+
27
+ if [ -f $cached ]; then
28
+ mocPath=$(cat $cached)
29
+ if [[ "$mocPath" != *"/moc" ]] ; then
30
+ mocPath="$(mops toolchain bin moc --fallback)"
31
+ echo -n $mocPath > "$cached"
32
+ fi;
33
+ else
34
+ mocPath="$(mops toolchain bin moc --fallback)"
35
+ echo -n $mocPath > "$cached"
36
+ fi;
37
+ fi;
38
+
39
+ $mocPath "$@"
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "bin/mops.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ic-mops",
3
- "version": "0.43.0",
3
+ "version": "0.44.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mops": "dist/bin/mops.js",