@@ -35,7 +35,7 @@ class NewOptions
3535 public string Version { get ; set ; }
3636
3737 [ Option ( 'p' , "pro" , Default = false , HelpText = "Use the pro version." ) ]
38- public bool Tier { get ; set ; }
38+ public bool Pro { get ; set ; }
3939
4040 [ Option ( 's' , "platform" , Default = ServerPlatform . Framework , HelpText = "Specify the .NET platform of the server to use." ) ]
4141 public ServerPlatform Platform { get ; set ; }
@@ -104,11 +104,16 @@ private static int New(NewOptions opts)
104104
105105 Console . WriteLine ( $ "Cleaning up extracted artifacts...") ;
106106
107+ string version = opts . Version ?? VersionManager . GetLatestDarkRiftVersion ( ) ;
108+
107109 foreach ( string path in Directory . GetFiles ( targetDirectory , "*.*" , SearchOption . AllDirectories ) )
108- FileTemplater . TemplateFileAndPath ( path , Path . GetFileName ( targetDirectory ) , opts . Version ?? VersionManager . GetLatestDarkRiftVersion ( ) , opts . Tier ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
110+ FileTemplater . TemplateFileAndPath ( path , Path . GetFileName ( targetDirectory ) , version , opts . Pro ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
109111
110112 Console . WriteLine ( Output . Green ( $ "Created '{ Path . GetFileName ( targetDirectory ) } '") ) ;
111113
114+ // Make sure that the given DarkRift version is actually downloaded.
115+ VersionManager . GetInstallationPath ( version , opts . Pro ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
116+
112117 return 0 ;
113118 }
114119
@@ -122,7 +127,7 @@ private static int Run(RunOptions opts)
122127 project . Save ( ) ;
123128 }
124129
125- string path = VersionManager . GetInstallationPath ( Version . Parse ( project . Runtime . Version ) , project . Runtime . Tier , project . Runtime . Platform ) ;
130+ string path = VersionManager . GetInstallationPath ( project . Runtime . Version , project . Runtime . Tier , project . Runtime . Platform ) ;
126131 if ( path == null )
127132 return 1 ;
128133
@@ -191,7 +196,7 @@ private static int Get(GetOptions opts)
191196
192197 private static int Pull ( PullOptions opts )
193198 {
194- string path = VersionManager . GetInstallationPath ( Version . Parse ( opts . Version ) , opts . Tier ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
199+ string path = VersionManager . GetInstallationPath ( opts . Version , opts . Tier ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
195200
196201 if ( path == null )
197202 return 1 ;
0 commit comments