Skip to content
Browse files

make sure we remove the uri file.

  • Loading branch information...
1 parent f5f3345 commit 38189605ed6ecf9b7ea4a98da1082273095d8bae @benoitc benoitc committed
Showing with 13 additions and 8 deletions.
  1. +12 −4 contrib/rcouchx/CouchDBXApplicationController.m
  2. +1 −4 package/osx/Makefile
View
16 contrib/rcouchx/CouchDBXApplicationController.m
@@ -16,6 +16,7 @@ -(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)app
-(void)applicationWillTerminate:(NSNotification *)notification
{
[self ensureFullCommit];
+
}
- (void)windowWillClose:(NSNotification *)aNotification
@@ -116,6 +117,11 @@ -(IBAction)start:(id)sender
[self launchCouchDB];
}
+-(void)deleteUri
+{
+ [[NSFileManager defaultManager] removeItemAtPath:[self uriFile] error:NULL];
+}
+
-(void)stop
{
NSFileHandle *writer;
@@ -127,9 +133,8 @@ -(void)stop
[start setImage:[NSImage imageNamed:@"start.png"]];
[start setLabel:@"start"];
- if ([[NSFileManager defaultManager] fileExistsAtPath:[self uriFile]]) {
- [[NSFileManager defaultManager] removeItemAtPath:[self uriFile] error:NULL];
- }
+ [self deleteUri];
+
}
-(void)waitStartup
@@ -149,12 +154,13 @@ -(void)setInitParams
// determine data dir
NSString *dataDir = [self applicationSupportFolder];
-
// create if it doesn't exist
if(![[NSFileManager defaultManager] fileExistsAtPath:dataDir]) {
[[NSFileManager defaultManager] createDirectoryAtPath:dataDir withIntermediateDirectories:YES attributes:nil error:NULL];
}
+ // delete uri file if needed
+ [self deleteUri];
dictionary* iniDict = iniparser_load([[self finalConfigPath] UTF8String]);
if (iniDict == NULL) {
@@ -250,6 +256,8 @@ -(void)cleanup
out = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self];
+
+ [self deleteUri];
}
-(void)openFuton
View
5 package/osx/Makefile
@@ -19,8 +19,6 @@ build: clean buildrel
dmg: cleanrcouchx buildrcouchx
@echo "Building package $(PKGNAME)"
mkdir -p packages
- cd $(BUILDDIR)/$(APP)-$(REVISION) && \
- ditto -ck --keepParent "rcouchx.app" ../../packages/$(ZIPNAME)
cp -f osx/README.txt $(BUILDDIR)/$(APP)-$(REVISION)/
cp -f ../LICENSE $(BUILDDIR)/$(APP)-$(REVISION)/LICENSE.txt
cp -f osx/dmg-background.png $(BUILDDIR)/$(APP)-$(REVISION)
@@ -30,9 +28,8 @@ dmg: cleanrcouchx buildrcouchx
(cd $(BUILDDIR)/$(APP)-$(REVISION) && \
./makedmg.sh "$(DMGNAME)" "rcouchx.app" "rcouchx" dmg-background.png rcouch.icns)
cp -f $(BUILDDIR)/$(APP)-$(REVISION)/$(DMGNAME) packages/
- ditto -ck --keepParent "packages/$(DMGNAME)" packages/$(ZIPNAME)
cd packages && \
- shasum -a 256 $(DMGNAME) > $(DMGNAME).sha
+ zip $(ZIPNAME) $(DMGNAME)
cd packages && \
shasum -a 256 $(ZIPNAME) > $(ZIPNAME).sha

0 comments on commit 3818960

Please sign in to comment.
Something went wrong with that request. Please try again.