aboutsummaryrefslogtreecommitdiffstats
path: root/auth/util.go
diff options
context:
space:
mode:
authorPetter Rasmussen2016-01-18 21:54:26 +0100
committerPetter Rasmussen2016-01-18 21:54:26 +0100
commit4f4152ccf32acbd392c7d80e45834ca1f3ea2d62 (patch)
treea61c9e6fcb6ede8c659ac8d76b491dbef5edafcc /auth/util.go
parente60833f88408139c8a92c3de9e8bfb87f295433e (diff)
downloadgdrive-4f4152ccf32acbd392c7d80e45834ca1f3ea2d62.tar.bz2
Simplify drive wrapper, s/client/auth/
Diffstat (limited to 'auth/util.go')
-rw-r--r--auth/util.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/auth/util.go b/auth/util.go
new file mode 100644
index 0000000..b053c1f
--- /dev/null
+++ b/auth/util.go
@@ -0,0 +1,22 @@
+package auth
+
+import (
+ "os"
+ "path/filepath"
+)
+
+func mkdir(path string) error {
+ dir := filepath.Dir(path)
+ if fileExists(dir) {
+ return nil
+ }
+ return os.Mkdir(dir, 0700)
+}
+
+func fileExists(path string) bool {
+ _, err := os.Stat(path)
+ if err == nil {
+ return true
+ }
+ return false
+}