Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion lib/install.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const BinWrapper = require('bin-wrapper');
const build = require('bin-build');
const spinner = require('simple-spinner');

const config = require('./config');
Expand Down Expand Up @@ -34,7 +35,17 @@ async function install(logLevel) {
spinner.stop();
logger.info(`Theme Kit path: ${pathToExecutable}`);
} catch (err) {
throw new Error(err);
spinner.stop();
console.log('Error using downloaded executable:', err.message);
console.log('Attempting to build from source...');
spinner.start();

cleanFile(pathToExecutable);
await build.url(`https://github.com/Shopify/themekit/archive/refs/tags/v${config.version}.tar.gz`, [
'make build GOBIN=' + __dirname + '/../bin',
'make install GOBIN=' + __dirname + '/../bin'
]);
spinner.stop();
}
}

Expand Down
Loading