HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/git-parse/dist/git_pull.js.flow
import promisify from 'util.promisify';
import childProcess from 'child_process';
import {validatePath, resolveHome} from './util';

const exec = promisify(childProcess.exec);

/**
 * Pulls a repo given its path.
 *
 * Returns void. Throws error on failure.
 */
const gitPull = async pathToRepo => {
  const resolvedPath = resolveHome(pathToRepo);

  try {
    validatePath(resolvedPath);
  } catch (e) {
    return Promise.reject(e);
  }

  return exec(`git pull`, {cwd: resolvedPath});
};

export default gitPull;