Skip to content

Commit 111d368

Browse files
authored
Merge pull request #150 from cosmology-tech/feat/from-branch
Feat/from branch
2 parents d8c8921 + ee9fb8b commit 111d368

File tree

3 files changed

+22
-13
lines changed

3 files changed

+22
-13
lines changed

packages/create-cosmos-app/src/utils.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,22 @@ export const cloneRepo = (argv, repo, name) => {
3939
const dir = join(argv.tmpdir || tmpdir(), tempname);
4040
mkdirp(dir);
4141
shell.cd(dir);
42-
shell.exec(`git clone --depth 1 ${repo} ${name}`);
42+
43+
// Initialize the command arguments in an array
44+
let gitCloneArgs = ['git', 'clone', '--depth', '1'];
45+
46+
// Add the branch argument if argv.fromBranch is provided
47+
if (argv.fromBranch) {
48+
gitCloneArgs.push('-b', argv.fromBranch);
49+
}
50+
51+
// Add the repository and name arguments
52+
gitCloneArgs.push.apply(repo, name);
53+
54+
// Join the arguments with spaces to form the command
55+
const gitCloneCommand = gitCloneArgs.join(' ');
56+
57+
shell.exec(gitCloneCommand);
4358
return dir;
4459
}
4560

templates/connect-chain/package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@
1616
"@chakra-ui/react": "2.5.1",
1717
"@cosmjs/cosmwasm-stargate": "0.31.1",
1818
"@cosmjs/stargate": "0.31.1",
19-
"@cosmos-kit/core": "^2.6.6",
20-
"@cosmos-kit/cosmostation": "^2.3.11",
21-
"@cosmos-kit/keplr": "^2.3.13",
22-
"@cosmos-kit/leap": "^2.3.10",
23-
"@cosmos-kit/react": "^2.8.4",
2419
"@emotion/react": "11.10.6",
2520
"@emotion/styled": "11.10.6",
2621
"chain-registry": "1.20.0",
22+
"cosmos-kit": "2.7.9",
2723
"framer-motion": "9.0.7",
2824
"next": "12.2.5",
2925
"react": "18.2.0",
@@ -39,4 +35,4 @@
3935
"generate-lockfile": "0.0.12",
4036
"typescript": "4.9.3"
4137
}
42-
}
38+
}

templates/connect-chain/pages/_app.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import '../styles/globals.css';
22
import type { AppProps } from 'next/app';
3-
import { ChainProvider } from '@cosmos-kit/react';
43
import { ChakraProvider } from '@chakra-ui/react';
5-
import { wallets as keplrWallets } from '@cosmos-kit/keplr';
6-
import { wallets as cosmostationWallets } from '@cosmos-kit/cosmostation';
7-
import { wallets as leapWallets } from '@cosmos-kit/leap';
84

9-
import { SignerOptions } from '@cosmos-kit/core';
5+
import { ChainProvider } from '@cosmos-kit/react';
6+
import { SignerOptions, wallets } from 'cosmos-kit';
107
import { chains, assets } from 'chain-registry';
8+
119
import { defaultTheme } from '../config';
1210
import '@interchain-ui/react/styles';
1311

@@ -23,7 +21,7 @@ function CreateCosmosApp({ Component, pageProps }: AppProps) {
2321
<ChainProvider
2422
chains={chains}
2523
assetLists={assets}
26-
wallets={[...keplrWallets, ...cosmostationWallets, ...leapWallets]}
24+
wallets={wallets}
2725
walletConnectOptions={{
2826
signClient: {
2927
projectId: 'a8510432ebb71e6948cfd6cde54b70f7',

0 commit comments

Comments
 (0)