File tree Expand file tree Collapse file tree
packages/theme/src/cli/commands/theme Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,11 +104,18 @@ describe('theme init', () => {
104104 expect ( cloneRepo ) . toHaveBeenCalledWith ( 'https://github.com/Shopify/dawn.git' , expect . any ( String ) )
105105 } )
106106
107- test ( 'uses the latest tag for a custom repository when stdin is not a TTY' , async ( ) => {
107+ test ( 'keeps the default branch for a custom repository when stdin is not a TTY' , async ( ) => {
108108 Object . defineProperty ( process . stdin , 'isTTY' , { configurable : true , value : false } )
109109
110110 await run ( [ '--clone-url=https://github.com/Shopify/dawn.git' ] )
111111
112+ expect ( cloneRepo ) . toHaveBeenCalledWith ( 'https://github.com/Shopify/dawn.git' , expect . any ( String ) )
113+ expect ( cloneRepoAndCheckoutLatestTag ) . not . toHaveBeenCalled ( )
114+ } )
115+
116+ test ( 'uses the latest tag for a custom repository with --latest' , async ( ) => {
117+ await run ( [ '--clone-url=https://github.com/Shopify/dawn.git' , '--latest' ] )
118+
112119 expect ( cloneRepoAndCheckoutLatestTag ) . toHaveBeenCalledWith (
113120 'https://github.com/Shopify/dawn.git' ,
114121 expect . any ( String ) ,
Original file line number Diff line number Diff line change @@ -65,10 +65,11 @@ export default class Init extends ThemeCommand {
6565 const name = args . name ?? ( await this . promptName ( flags . path , inputDisabled ) )
6666 const repoUrl = flags [ 'clone-url' ]
6767 const destination = joinPath ( flags . path , name )
68- let latestRelease = flags . latest || inputDisabled
68+ let latestRelease = flags . latest
6969
7070 if ( ! latestRelease && repoUrl === SKELETON_THEME_URL ) {
7171 latestRelease =
72+ inputDisabled ||
7273 ! terminalSupportsPrompting ( ) ||
7374 ( await renderSelectPrompt ( {
7475 message : 'Which version of Skeleton theme would you like to use?' ,
You can’t perform that action at this time.
0 commit comments