浏览代码

Query node build: sed -i => sed -i.bak for Mac compatibility

Leszek Wiesner 3 年之前
父节点
当前提交
b2085e2090
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      query-node/build.sh

+ 5 - 2
query-node/build.sh

@@ -17,10 +17,13 @@ yarn codegen:noinstall
 yarn typegen # if this fails try to run this command outside of yarn workspaces
 
 # TS4 useUnknownInCatchVariables is not compatible with auto-generated code
-sed -i '/\"compilerOptions\"\:\ {/a \ \ \ \ "useUnknownInCatchVariables": false,' ./generated/graphql-server/tsconfig.json
+# i.bak is used for Mac compatibility
+sed -i.bak '/\"compilerOptions\"\:\ {/a \ \ \ \ "useUnknownInCatchVariables": false,' ./generated/graphql-server/tsconfig.json
+rm ./generated/graphql-server/tsconfig.json.bak
 # Type assertions are no longer needed for createTypeUnsafe in @polkadot/api 5.9.1 (and they break the build)
 # Here we're relpacing createTypeUnsafe<Assertions>(...params) to createTypeUnsafe(...params) in all generated types:
-find ./mappings/generated -type f -print0 | xargs -0 sed -ri 's/createTypeUnsafe<[^(]+[(]/createTypeUnsafe(/g'
+find ./mappings/generated -type f -print0 | xargs -0 sed -i.bak -r 's/createTypeUnsafe<[^(]+[(]/createTypeUnsafe(/g'
+find ./mappings/generated -type f -iname "*.bak" -print0 | xargs -0 rm -f
 
 # We run yarn again to ensure graphql-server dependencies are installed
 # and are inline with root workspace resolutions