Creates files specified in `/scaffolds/:type/files.json`.
769481
function createFiles(next) {
    var files = common.directories.normalize(
      common.mixin({}, flatiron.constants.DIRECTORIES, { '#ROOT': root }),
      JSON.parse(fs.readFileSync(path.join(scaffold, 'files.json'), 'utf8'))
    );

    function copyFile(file, nextFile) {
      app.log.info('Writing file ' + file.grey);
      common.cpr(path.join(scaffold, file), files[file], nextFile);
    }

    common.async.mapSeries(Object.keys(files), copyFile, next);
  }
259480
def write_json(data, path, file_name):
    
    if os.path.exists(path) and not os.path.isdir(path):
        return
    elif not os.path.exists(path):
        mkdir_p(path)
    with open(os.path.join(path, file_name), 'w') as f:
        json_tricks.dump(data, f, indent=4, primitives=True, allow_nan=True)
1189006
def build_files(payload, dirname=None, indent=4, tabs=False, header=False):
    
    if dirname is None:
        dirname = os.getcwd()

    for config in payload['config']:
        path = config['file']
        if not os.path.isabs(path):
            path = os.path.join(dirname, path)

        # make directories that need to be made for the config to be built
        dirpath = os.path.dirname(path)
        if not os.path.exists(dirpath):
            os.makedirs(dirpath)

        # build then create the nginx config file using the json payload
        parsed = config['parsed']
        output = build(parsed, indent=indent, tabs=tabs, header=header)
        output = output.rstrip() + '\n'
        with codecs.open(path, 'w', encoding='utf-8') as fp:
            fp.write(output)
1036249
def add(self, files):
    
    if files.__class__.__name__ == 'str':
      self._files.append(files)
    else:
      self._files.extend(files)
108385
@GwtIncompatible("Unnecessary")
  private List<SourceFile> createInputs(
      List<FlagEntry<JsSourceType>> files,
      List<JsonFileSpec> jsonFiles,
      List<JsModuleSpec> jsModuleSpecs)
      throws IOException {
    return createInputs(files, jsonFiles, /* allowStdIn= */ false, jsModuleSpecs);
  }
313068
function createResource (req) {
  let resource = new Resource(req.path);

  if (!_.isEmpty(req.files)) {
    // Save file data too
    resource.data = _.extend({}, req.body, req.files);
  }
  else {
    resource.data = req.body;
  }

  return resource;
}
164258
function generateUtilityFiles(next) {
    fs.copy(path.join(getConfig('template.folder'), 'index.js'), path.join(getConfig('output.folder'), 'index.js'), function (err) {
        if (err) { next(err); return; }
        if (getConfig('output.log')) { logger.info('(Created) Index file: ' + path.resolve(path.join(getConfig('output.folder'), 'index.js'))); }
        fs.copy(path.join(getConfig('template.folder'), '..', 'utils.js'), path.join(getConfig('output.folder'), 'utils.js'), function (err) {
            if (err) { next(err); return; }
            next(null);
        });
    });
    try {
        overriddenAliases = require(path.join(process.cwd(), getConfig('output.folder'), 'alias.json'));
    } catch (ignore) {}
}
652564
def create_dirs(self):
        
        if not os.path.isdir(self._path):
            os.makedirs(self._path)
        for dir_name in [self.OBJ_DIR, self.TMP_OBJ_DIR, self.PKG_DIR, self.CACHE_DIR]:
            path = os.path.join(self._path, dir_name)
            if not os.path.isdir(path):
                os.mkdir(path)
        if not os.path.exists(self._version_path()):
            self._write_format_version()
910502
def new_files
      files = Set.new
      site.each_site_file { |item| files << item.destination(site.dest) }
      files
    end
874242
function repoFiles (options, callback) {
  var url = options.url
  var files = options.files

  if (!url || !files) {
    return callback(new Error('must specify url, files'))
  }

  var data = []

  async.forEachOf(files, function (item, key, callback) {
    request({
      url: url + item.name
    }, function (err, json) {
      if (err) return callback(err)

      if (json && json.type && json.type === 'FeatureCollection') {
        json.name = item.name
        json.sha = item.sha
        data.push(json)

        return callback(null)
      }

      callback(new Error('problem accessing file ' + url + '/' + key))
    })
  }, function (err) {
    if (err) return callback(err)
    callback(null, data)
  })
}
982632
protected function _generateFiles() {
        $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", false);
        $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", false);
        
        $this->generateFilesForArtifacts($this->selectedArtifacts, "getFileSettingsForSelected", true);
        $this->generateFilesForArtifacts($this->deselectedArtifacts, "getFileSettingsForDeselected", true);

        foreach ($this->extendableFiles as $extendableFile)
            $this->files[] = $extendableFile;
    }
561611
private function create_json() {
		$packages = $this->list_directory( $this->packages_dir );
		$arr      = array();

		foreach ( $packages as $package ) {
			foreach ( $this->translations as $translation ) {
				if ( false !== stripos( $package, $translation ) ) {
					$locale                       = ltrim( strrchr( $translation, '-' ), '-' );
					$arr[ $locale ]['slug']       = stristr( $translation, strrchr( $translation, '-' ), true );
					$arr[ $locale ]['language']   = $locale;
					$arr[ $locale ]['updated']    = $this->get_po_revision( $translation . '.po' );
					$arr[ $locale ]['package']    = '/packages/' . $package;
					$arr[ $locale ]['autoupdate'] = '1';
				}
			}
		}

		file_put_contents( $this->root_dir . '/language-pack.json', json_encode( $arr ) );
		printf( "\n<br>" . 'language-pack.json created.' . "\n<br>" );
	}
77378
def create(self):
        
        if os.path.isfile(self.path):
            if not os.path.exists(self.path):
                with open(self.path, 'w') as fileobj:
                    fileobj.write('')
        else:
            os.makedirs(self.path)
723246
function createFileTree (filePaths)
{
  var path = require ('path')
    , root = {
    files:      [],
    subfolders: new Map
  };

  filePaths.forEach (function (filename)
  {
    var dir = path.dirname (filename)
      , folderPtr = root;
    if (dir)
      dir.split (path.sep).forEach (function (segment)
      {
        if (!folderPtr.subfolders.has (segment))
          folderPtr.subfolders.set (segment, {
            files:      [],
            subfolders: new Map
          });
        folderPtr = folderPtr.subfolders.get (segment);
      });
    folderPtr.files.push (filename);
  });
  return root;
}
289997
def _create_json(self):
        
        data_json = {
            "rclass": "local",
            "key": self.name,
            "description": self.description,
            "packageType": self.packageType,
            "notes": "",
            "includesPattern": "**/*",
            "excludesPattern": "",
            "repoLayoutRef": self.repoLayoutRef,
            "dockerApiVersion": self.dockerApiVersion,
            "checksumPolicyType": "client-checksums",
            "handleReleases": True,
            "handleSnapshots": True,
            "maxUniqueSnapshots": 0,
            "snapshotVersionBehavior": "unique",
            "suppressPomConsistencyChecks": True,
            "blackedOut": False,
            "propertySets": [],
            "archiveBrowsingEnabled": self.archiveBrowsingEnabled,
            "yumRootDepth": 0,
        }
        return data_json
126708
public function maybeCreateExportFolders()
    {
        if (!is_writable($this->exportFolder)) {
            trigger_error('The export folder (' . $this->exportFolder .') is not writable. Exports will not be saved.', E_USER_ERROR);
        }

        if (!file_exists($this->exportFolder . 'json')) {
            mkdir($this->exportFolder . 'json');
            chmod($this->exportFolder . 'json', 0777);
        }

        if (!file_exists($this->exportFolder . 'php')) {
            mkdir($this->exportFolder . 'php');
            chmod($this->exportFolder . 'php', 0777);
        }
    }
1235244
function createResources (req) {
  let resources = [],
      body = req.body,
      schema = util.getRequestSchema(req.swagger.path, req.swagger.operation);

  if (!_.isArray(body)) {
    if (!_.isEmpty(req.files)) {
      // Save file data too
      body = _.extend({}, req.body, req.files);
    }

    // Normalize to an array
    body = [body];
  }

  // Create a REST resource for each item in the array
  for (let i = 0; i < body.length; i++) {
    let data = body[i];

    // Determine the resource's "Name" property
    let propInfo = getResourceName(data, schema);

    if (propInfo.name) {
      // Update the data, so the new name is saved with the resource data
      data = data || {};
      if (data[propInfo.name] === undefined) {
        data[propInfo.name] = propInfo.value;
        body[i] = data;
      }
    }

    // Create a resource name that is a safe URL string (2000 character max)
    let resourceName = new JsonSchema(propInfo.schema).serialize(propInfo.value);
    resourceName = _(resourceName).toString().substring(0, 2000);
    resourceName = encodeURIComponent(resourceName);

    // Create a REST resource
    let resource = new Resource(req.path, resourceName, data);
    resources.push(resource);
  }

  return resources;
}