diff options
| -rw-r--r-- | DomeKey/LicenseHandler.m | 17 | 
1 files changed, 12 insertions, 5 deletions
| diff --git a/DomeKey/LicenseHandler.m b/DomeKey/LicenseHandler.m index b18bd77..c6e0e9c 100644 --- a/DomeKey/LicenseHandler.m +++ b/DomeKey/LicenseHandler.m @@ -16,11 +16,7 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist";  {      if ([self licenseFileExists]) {          if (![self validateLicense]) { -            eprintf( -                "The license file '%s' is invalid. " -                "Try adding your license again using the `--license` flag.\n", -                [[[self licensePath] path] UTF8String] -            ); +            [self printInvalidLicenseMessage];              // TODO: then do trial          } @@ -53,6 +49,8 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist";          printf("Thank you for registering DomeKey!\n");      }      else { +        [self printInvalidLicenseMessage]; +          [[NSWorkspace sharedWorkspace]              recycleURLs:[NSArray arrayWithObject:[self licensePath]]              completionHandler:^(NSDictionary<NSURL *,NSURL *> *newURLs, NSError *error) { @@ -129,4 +127,13 @@ static NSString * const LICENSE_FILE_NAME = @"license.plist";      return validated;  } ++ (void)printInvalidLicenseMessage +{ +    eprintf( +        "The license file '%s' is invalid. " +        "Try adding your license again using the `--license` flag.\n", +        [[[self licensePath] path] UTF8String] +    ); +} +  @end | 
