@taqueria/plugin-ligo 0.0.0-pr-155-8d8b3d05 → 0.0.0-pr-149-70de2cae
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/compile.js +7 -4
- package/index.js +1 -1
- package/package.json +1 -1
package/compile.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import {execCmd, getArch} from '@taqueria/node-sdk'
|
|
2
2
|
const {extname, basename, join} = require('path')
|
|
3
3
|
const glob = require('fast-glob')
|
|
4
4
|
|
|
5
|
+
|
|
5
6
|
const getContractArtifactFilename = (opts) => (sourceFile) => {
|
|
6
7
|
const outFile = basename(sourceFile, extname(sourceFile))
|
|
7
8
|
return join(opts.config.artifactsDir, `${outFile}.tz`)
|
|
@@ -11,10 +12,10 @@ const getInputFilename = (opts) => sourceFile => {
|
|
|
11
12
|
return join(opts.config.contractsDir, sourceFile)
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
const getCompileCommand = (opts) => (sourceFile) => {
|
|
15
|
+
const getCompileCommand = (opts, arch) => (sourceFile) => {
|
|
15
16
|
const {projectDir} = opts
|
|
16
17
|
const inputFile = getInputFilename (opts) (sourceFile)
|
|
17
|
-
const baseCommand = `docker run --rm -v \"${projectDir}\":/project -w /project ligolang/ligo:next compile contract ${inputFile}`
|
|
18
|
+
const baseCommand = `docker run --platform ${arch} --rm -v \"${projectDir}\":/project -w /project ligolang/ligo:next compile contract ${inputFile}`
|
|
18
19
|
const entryPoint = opts.e ? `-e ${opts.e}` : ""
|
|
19
20
|
const syntax = opts["-s"] ? `s ${opts['s']} : ""` : ""
|
|
20
21
|
const outFile = `-o ${getContractArtifactFilename(opts)(sourceFile)}`
|
|
@@ -43,7 +44,9 @@ const execCmd = cmd => new Promise((resolve, reject) => {
|
|
|
43
44
|
})
|
|
44
45
|
|
|
45
46
|
const compileContract = (opts) => (sourceFile) =>
|
|
46
|
-
|
|
47
|
+
getArch()
|
|
48
|
+
.then(arch => getCompileCommand(opts, arch) (sourceFile))
|
|
49
|
+
.then(execCmd)
|
|
47
50
|
.then(() => ({contract: sourceFile, artifact: getContractArtifactFilename(opts) (sourceFile)}))
|
|
48
51
|
|
|
49
52
|
const compileAll = parsedArgs => {
|
package/index.js
CHANGED
package/package.json
CHANGED