Android: Add .thumbnails to .gitignore when setting up a camera repository.

This commit is contained in:
Joey Hess 2013-06-10 16:41:02 -04:00
parent 855021a41f
commit 0b11c71740
3 changed files with 21 additions and 5 deletions

View file

@ -151,11 +151,18 @@ postFirstRepositoryR = page "Getting started" (Just Configuration) $ do
((res, form), enctype) <- liftH $ runFormPost $ newRepositoryForm path
case res of
FormSuccess (RepositoryPath p) -> liftH $
startFullAssistant (T.unpack p) ClientGroup
startFullAssistant (T.unpack p) ClientGroup Nothing
_ -> $(widgetFile "configurators/newrepository/first")
getAndroidCameraRepositoryR :: Handler ()
getAndroidCameraRepositoryR = startFullAssistant "/sdcard/DCIM" SourceGroup
getAndroidCameraRepositoryR =
startFullAssistant "/sdcard/DCIM" SourceGroup $ Just addignore
where
addignore = do
liftIO $ unlessM (doesFileExist ".gitignore") $
writeFile ".gitignore" ".thumbnails/*"
void $ inRepo $
Git.Command.runBool [Param "add", File ".gitignore"]
{- Adding a new local repository, which may be entirely separate, or may
- be connected to the current repository. -}
@ -315,13 +322,15 @@ driveList = return []
{- Bootstraps from first run mode to a fully running assistant in a
- repository, by running the postFirstRun callback, which returns the
- url to the new webapp. -}
startFullAssistant :: FilePath -> StandardGroup -> Handler ()
startFullAssistant path repogroup = do
startFullAssistant :: FilePath -> StandardGroup -> Maybe (Annex ())-> Handler ()
startFullAssistant path repogroup setup = do
webapp <- getYesod
url <- liftIO $ do
isnew <- makeRepo path False
u <- initRepo isnew True path Nothing
inDir path $ setStandardGroup u repogroup
inDir path $ do
setStandardGroup u repogroup
maybe noop id setup
addAutoStartFile path
setCurrentDirectory path
fromJust $ postFirstRun webapp

2
debian/changelog vendored
View file

@ -3,6 +3,8 @@ git-annex (4.20130602) UNRELEASED; urgency=low
* Supports indirect mode on encfs in paranoia mode, and other
filesystems that do not support hard links, but do support
symlinks and other POSIX filesystem features.
* Android: Add .thumbnails to .gitignore when setting up a camera
repository.
-- Joey Hess <joeyh@debian.org> Mon, 10 Jun 2013 12:52:44 -0400

View file

@ -21,3 +21,8 @@ Install git-annex on Android and choose the defaults for a camera repository.
# End of transcript or log.
"""]]
> I've [[done]] this, however the .gitignore file it writes will
> not actually be used by the assistant until it gets support
> for querying gitignore settings from git. There is already a
> bug tracking that, and it's in process. --[[Joey]]