From 1484ba2de80a28c1e7fe8dfa7bc307f8f7feab99 Mon Sep 17 00:00:00 2001 From: Aliaksandr Bahdanau Date: Fri, 12 Jul 2024 16:39:56 +0300 Subject: [PATCH 1/2] fix: fix windows yarn bootstrap --- CHANGELOG.md | 6 ++++++ src/cli.ts | 33 +++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dff7d4..1d31144 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.15.1] - 2024-07-12 + +### Fixed + +- Fixed failed blueprint bootstrap on windows + ## [0.15.0] - 2024-06-19 ### Changed diff --git a/src/cli.ts b/src/cli.ts index 7f9e980..f46cfc6 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -147,19 +147,28 @@ Session.vim console.log(`\n[3/${steps}] Creating your first contract...`); - let execCommand = 'npm'; - switch (pkgManager) { - case 'yarn': - execCommand = 'yarn'; - break; - case 'pnpm': - execCommand = 'pnpm'; - break; + const execArgs = `create ${contractName} --type ${variant}`; + + // below is fix for windows. Windows does not accept yarn exec to find binaries somehow so binary path specified directly + if (pkgManager === 'yarn' && process.platform === 'win32') { + const blueprintBinariesPath = path.join(projectPath, 'node_modules', '.bin', 'blueprint'); + execSync(`${blueprintBinariesPath} ${execArgs}`, execOpts); + } else { + let execCommand = 'npm'; + switch (pkgManager) { + case 'yarn': + execCommand = 'yarn'; + break; + case 'pnpm': + execCommand = 'pnpm'; + break; + } + execSync( + `${execCommand} exec blueprint${pkgManager === 'pnpm' ? '' : ' --'} ${execArgs}`, + execOpts + ); } - execSync( - `${execCommand} exec blueprint${pkgManager === 'pnpm' ? '' : ' --'} create ${contractName} --type ${variant}`, - execOpts - ); + try { execSync('git init', execOpts); From e80aba8da0bd385c2fdd20259930e06532217643 Mon Sep 17 00:00:00 2001 From: Aliaksandr Bahdanau Date: Fri, 12 Jul 2024 16:58:09 +0300 Subject: [PATCH 2/2] chore: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e6960b4..6541e9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-ton", - "version": "0.15.0", + "version": "0.15.1", "license": "MIT", "description": "Tool to quickly create TON projects", "author": "TonTech",