1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# Copyright (c) 2011 The Chromium Authors. All rights reserved.
4
5# Use of this source code is governed by a BSD-style license that can be
6# found in the LICENSE file.
7"""Writes True if the argument is a directory."""
8
9import os.path
10import sys
11
12
13def main() -> int:
14    sys.stdout.write(_is_dir(sys.argv[1]))
15    return 0
16
17
18def _is_dir(dir_name) -> str:
19    return str(os.path.isdir(dir_name))
20
21
22def do_main(args):
23    """Hook to be called from gyp without starting a separate python
24    interpreter.
25    """
26    return _is_dir(args[0])
27
28
29if __name__ == '__main__':
30    sys.exit(main())
31