Attempt to locate and set the paths to the binary with the
        working directory defined for this instance.
334463
def _set_env_path_with_node_modules(self):
        

        modcls_name = ':'.join((
            self.__class__.__module__, self.__class__.__name__))

        if self.binary is None:
            raise ValueError(
                "binary undefined for '%s' instance" % modcls_name)

        logger.debug(
            "locating '%s' node binary for %s instance...",
            self.binary, modcls_name,
        )

        default = self.which()
        if default is not None:
            logger.debug(
                "found '%s'; "
                "not modifying PATH environment variable in instance of '%s'.",
                realpath(default), modcls_name)
            return True

        target = self.which_with_node_modules()

        if target:
            # Only setting the path specific for the binary; side effect
            # will be whoever else borrowing the _exec in here might not
            # get the binary they want.  That's why it's private.
            self.env_path = dirname(target)
            logger.debug(
                "located '%s' binary at '%s'; setting PATH environment "
                "variable for '%s' instance.",
                self.binary, self.env_path, modcls_name
            )
            return True
        else:
            logger.debug(
                "Unable to locate '%s'; not modifying PATH environment "
                "variable for instance of '%s'.",
                self.binary, modcls_name
            )
            return False
660644
def __set_rouge_dir(self, home_dir=None):
        
        if not home_dir:
            self._home_dir = self.__get_rouge_home_dir_from_settings()
        else:
            self._home_dir = home_dir
            self.save_home_dir()
        self._bin_path = os.path.join(self._home_dir, 'ROUGE-1.5.5.pl')
        self.data_dir = os.path.join(self._home_dir, 'data')
        if not os.path.exists(self._bin_path):
            raise Exception(
                "ROUGE binary not found at {}. Please set the "
                "correct path by running pyrouge_set_rouge_path "
                "/path/to/rouge/home.".format(self._bin_path))
502073
def step_use_curdir_as_working_directory(context):
    
    context.workdir = os.path.abspath(".")
    command_util.ensure_workdir_exists(context)
917368
def get_binary_path(executable):
    """"""
    if sys.platform == 'win32':
        if executable == 'start':
            return executable
        executable = executable + '.exe'
        if executable in os.listdir('.'):
            binary = os.path.join(os.getcwd(), executable)
        else:
            binary = next((os.path.join(path, executable)
                           for path in os.environ['PATH'].split(os.pathsep)
                           if os.path.isfile(os.path.join(path, executable))), None)
    else:
        binary = Popen(['which', executable], stdout=PIPE).stdout.read().strip().decode('utf-8')
    return binary if binary else None
318107
def setBundlePath(path):
    
    if os.path.exists(path):
        Settings.BundlePath = path
    else:
        raise OSError("File not found: " + path)
29747
def get_binary_path(executable, logging_level='INFO'):
    """"""
    if sys.platform == 'win32':
        if executable == 'start':
            return executable
        executable = executable + '.exe'
        if executable in os.listdir('.'):
            binary = os.path.join(os.getcwd(), executable)
        else:
            binary = next((os.path.join(path, executable)
                           for path in os.environ['PATH'].split(os.pathsep)
                           if os.path.isfile(os.path.join(path, executable))), None)
    else:
        venv_parent = get_venv_parent_path()
        venv_bin_path = os.path.join(venv_parent, '.venv', 'bin')
        if not venv_bin_path in os.environ.get('PATH'):
            if logging_level == 'DEBUG':
                print(f'Adding path {venv_bin_path} to environment PATH variable')
            os.environ['PATH'] = os.pathsep.join([os.environ['PATH'], venv_bin_path])
        binary = shutil.which(executable)
    return binary if binary else None
930534
def step_a_new_working_directory(context):
    
    command_util.ensure_context_attribute_exists(context, "workdir", None)
    command_util.ensure_workdir_exists(context)
    shutil.rmtree(context.workdir, ignore_errors=True)
974990
def setup_dir(self):
        """"""
        cd = self.opts.cd or self.config['crony'].get('directory')
        if cd:
            self.logger.debug(f'Adding cd to {cd}')
            self.cmd = f'cd {cd} && {self.cmd}'
397042
def setup_pathing(self):
        """"""
        self.s3_version_uri = self._path_formatter(self.version)
        self.s3_latest_uri = self._path_formatter("LATEST")
        self.s3_canary_uri = self._path_formatter("CANARY")
        self.s3_alpha_uri = self._path_formatter("ALPHA")
        self.s3_mirror_uri = self._path_formatter("MIRROR")
1237973
def create_fpath_dir(self, fpath: str):
        """"""
        os.makedirs(os.path.dirname(fpath), exist_ok=True)
419612
def mkdir(self, path):
        
        if not os.path.exists(path):
            os.makedirs(path)
466186
private void addBinaryResourcePath(BinaryResourcesHandler binRsHandler, String resourcePath) {

		try {
			String resultPath = CheckSumUtils.getCacheBustedUrl(resourcePath, rsReaderHandler, jawrConfig);
			binRsHandler.addMapping(resourcePath, resultPath);
			bundleMapping.put(resourcePath, resultPath);
		} catch (IOException e) {
			LOGGER.error("An exception occurs while defining the mapping for the file : " + resourcePath, e);
		} catch (ResourceNotFoundException e) {
			LOGGER.error("Impossible to define the checksum for the resource '" + resourcePath
					+ "'. Unable to retrieve the content of the file.");
		}
	}
941060
public void setWorkingDirectory(String path) {
        if (path != null) {
            File dir = new File(path);
            checkWorkingDir(dir);
            workingDir = dir;
        } else {
            workingDir = null;
        }
    }
578233
public void setWorkingDirectory(File dir) {
        if (!dir.exists()) {
            throw new IllegalArgumentException(dir + " doesn't exist.");
        }
        pb.directory(dir);
    }
1296966
def _workdir(self, line):
        '''

        '''
        workdir = self._setup('WORKDIR', line)
        line = "cd %s" %(''.join(workdir))
        self.install.append(line)
427914
def working_directory(self):
        
        _complain_ifclosed(self.closed)
        wd = self.fs.get_working_directory()
        return wd
374796
def _set_directories(self):
        ''''''
        if self._dirs['initial'] == None:
            self._dirs['base'] = discover_base_dir(self._dirs['run'])  
        else:
            self._dirs['base'] = discover_base_dir(self._dirs['initial'])  
        # now, if 'base' is None (no base directory was found) then the only
        # allowed operation is init 
        self._update_dirs_on_base()
        # we might have set the directory variables fine, but the tree
        # might not exist yet. _tree_ready is a flag for that.
        self._tree_ready = verify_dir_structure(self._dirs['base'])
        if self._tree_ready:
            self._read_site_config()