code: function ensureDir(dir) {
          try {
              if (!fs_1.existsSync(dir))
                  fs_1.mkdirSync(dir);
              return true;
          }
          catch (ex) {
              return false;
          }
      }
docs: Ensure Dir
  : Ensures the directory where completions.sh will be stored exists.
  If it does not it creates it.
  
  @param dir the directory where the completions.sh file will be saved.