Browse Source

move umask to init/__config__

apkallum 5 years ago
parent
commit
b854884c56
2 changed files with 2 additions and 2 deletions
  1. 2 0
      archivebox/config/__init__.py
  2. 0 2
      archivebox/main.py

+ 2 - 0
archivebox/config/__init__.py

@@ -864,3 +864,5 @@ def setup_django(out_dir: str=None, check_db=False, config: ConfigDict=CONFIG) -
                 f'No database file {SQL_INDEX_FILENAME} found in OUTPUT_DIR: {config["OUTPUT_DIR"]}')
                 f'No database file {SQL_INDEX_FILENAME} found in OUTPUT_DIR: {config["OUTPUT_DIR"]}')
     except KeyboardInterrupt:
     except KeyboardInterrupt:
         raise SystemExit(2)
         raise SystemExit(2)
+
+os.umask(0o777 - int(OUTPUT_PERMISSIONS, base=8))

+ 0 - 2
archivebox/main.py

@@ -87,7 +87,6 @@ from .config import (
     CONFIG,
     CONFIG,
     USER_CONFIG,
     USER_CONFIG,
     get_real_name,
     get_real_name,
-    OUTPUT_PERMISSIONS
 )
 )
 from .logging_util import (
 from .logging_util import (
     TERM_WIDTH,
     TERM_WIDTH,
@@ -241,7 +240,6 @@ def run(subcommand: str,
 @enforce_types
 @enforce_types
 def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None:
 def init(force: bool=False, out_dir: str=OUTPUT_DIR) -> None:
     """Initialize a new ArchiveBox collection in the current directory"""
     """Initialize a new ArchiveBox collection in the current directory"""
-    os.umask(0o777 - int(OUTPUT_PERMISSIONS, base=8))
     os.makedirs(out_dir, exist_ok=True)
     os.makedirs(out_dir, exist_ok=True)
     is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)
     is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)
     existing_index = os.path.exists(os.path.join(out_dir, JSON_INDEX_FILENAME))
     existing_index = os.path.exists(os.path.join(out_dir, JSON_INDEX_FILENAME))