diff --git a/npm_publish/index.js b/npm_publish/index.js index 678e7292..2addb97a 100644 --- a/npm_publish/index.js +++ b/npm_publish/index.js @@ -10,8 +10,6 @@ const ARCH_MAPPING = { arm64: 'arm64', }; const PLATFORM_MACOS = 'darwin'; -// The "fat" macOS binary includes code for both x64 and arm64 architectures -const GO_ARCH_FAT = 'fat'; // Mapping between Node's `process.platform` to Golang's const PLATFORM_MAPPING = { [PLATFORM_MACOS]: PLATFORM_MACOS, @@ -24,7 +22,7 @@ let fullPath = null; /** * @return {Promise} */ -export async function findGoIosBinary() { +async function findGoIosBinary() { if (fullPath) { // return the previously cached value return fullPath; @@ -33,7 +31,7 @@ export async function findGoIosBinary() { const binaryName = `ios${process.platform === 'win32' ? '.exe' : ''}`; const binaryRoot = path.join(__dirname, 'dist'); const goPlatform = PLATFORM_MAPPING[process.platform]; - const goArch = goPlatform === PLATFORM_MACOS ? GO_ARCH_FAT : ARCH_MAPPING[process.arch]; + const goArch = ARCH_MAPPING[process.arch]; if (goPlatform && goArch) { const sysFolderName = `go-ios-${goPlatform}-${goArch}_${goPlatform}_${goArch}`; fullPath = path.join(binaryRoot, sysFolderName, binaryName); @@ -51,6 +49,8 @@ export async function findGoIosBinary() { return fullPath; } +exports.findGoIosBinary = findGoIosBinary; + /** * @returns {Promise} */ diff --git a/npm_publish/package.json b/npm_publish/package.json index 998e6267..b146ba12 100644 --- a/npm_publish/package.json +++ b/npm_publish/package.json @@ -1,6 +1,7 @@ { "name": "go-ios", "version": "local-build", + "type":"commonjs", "description": "Provide a stable and production ready opensource solution to automate iOS device on Linux, Windows and Mac OS X.", "main": "index.js", "scripts": {