@@ -57,7 +57,7 @@ class GetOptions
5757 [ Verb ( "pull" , HelpText = "Pulls the specified version of DarkRift locally." ) ]
5858 class PullOptions
5959 {
60- [ Value ( 0 , Required = true ) ]
60+ [ Value ( 0 , Required = false ) ]
6161 public String Version { get ; set ; }
6262
6363 [ Option ( 'p' , "pro" , Default = false , HelpText = "Use the pro version." ) ]
@@ -196,6 +196,30 @@ private static int Get(GetOptions opts)
196196
197197 private static int Pull ( PullOptions opts )
198198 {
199+ if ( string . IsNullOrEmpty ( opts . Version ) )
200+ {
201+ // if version info was omitted, overwrite any parameters with current project settings
202+ if ( Project . IsCurrentDirectoryAProject ( ) )
203+ {
204+ var project = Project . Load ( ) ;
205+
206+ opts . Version = project . Runtime . Version ;
207+ opts . Platform = project . Runtime . Platform ;
208+ opts . Tier = project . Runtime . Tier == ServerTier . Pro ;
209+ }
210+ else
211+ {
212+ Console . Error . WriteLine ( Output . Red ( $ "You can perform this command only in a project directory.") ) ;
213+ return 2 ;
214+ }
215+ }
216+
217+ // if version provided is "latest", it is being replaced with currently most recent one
218+ if ( opts . Version == "latest" )
219+ {
220+ opts . Version = VersionManager . GetLatestDarkRiftVersion ( ) ;
221+ }
222+
199223 string path = VersionManager . GetInstallationPath ( opts . Version , opts . Tier ? ServerTier . Pro : ServerTier . Free , opts . Platform ) ;
200224
201225 if ( path == null )
0 commit comments