diff --git a/build-scripts/postinstall.js b/build-scripts/postinstall.js index 70ce906a..8d9f50c7 100644 --- a/build-scripts/postinstall.js +++ b/build-scripts/postinstall.js @@ -15,6 +15,7 @@ var path = require( "path" ); var fs = require( "fs" ); var shelljs = require( "shelljs" ); +var os = require( "os" ); var repoPaths = require( "./helpers/repo-paths" ); var addonAbsoluteName = require( "bindings" )( { bindings: "iotivity", path: true } ); var addonAbsolutePath = path.dirname( addonAbsoluteName ); @@ -44,11 +45,15 @@ if ( !isDependency ) { // Purge intermediate build files but leave the addon where it is shelljs.mv( addonAbsoluteName, repoPaths.root ); -shelljs.mv( path.join( addonAbsolutePath, "octbstack.dll" ), repoPaths.root ); +if ( os.platform() === "win32" ) { + shelljs.mv( path.join( addonAbsolutePath, "octbstack.dll" ), repoPaths.root ); +} shelljs.rm( "-rf", path.join( repoPaths.root, "build" ) ); shelljs.mkdir( "-p", addonAbsolutePath ); shelljs.mv( path.join( repoPaths.root, addonName ), addonAbsolutePath ); -shelljs.mv( path.join( repoPaths.root, "octbstack.dll" ), addonAbsolutePath ); +if ( os.platform() === "win32" ) { + shelljs.mv( path.join( repoPaths.root, "octbstack.dll" ), addonAbsolutePath ); +} // Purge any and all files not needed after building shelljs.rm( "-rf",