Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const convertCmd = join(tempDir, 'bin', 'pipfile2req');
await pipenvConvert(convertCmd, pipfileLockDir);
}
fsFiles = await glob('**', workPath);
const requirementsTxt = join(entryDirectory, 'requirements.txt');
if (fsFiles[requirementsTxt]) {
debug('Found local "requirements.txt"');
const requirementsTxtPath = fsFiles[requirementsTxt].fsPath;
await installRequirementsFile({
filePath: requirementsTxtPath,
workPath,
meta,
});
} else if (fsFiles['requirements.txt']) {
debug('Found global "requirements.txt"');
const requirementsTxtPath = fsFiles['requirements.txt'].fsPath;
await installRequirementsFile({
filePath: requirementsTxtPath,
workPath,
meta,
});
}
const originalPyPath = join(__dirname, '..', 'now_init.py');
const originalNowHandlerPyContents = await readFile(originalPyPath, 'utf8');
// will be used on `from $here import handler`
// for example, `from api.users import handler`
debug('Entrypoint is', entrypoint);
const userHandlerFilePath = entrypoint
}
fsFiles = await glob('**', workPath);
const requirementsTxt = join(entryDirectory, 'requirements.txt');
if (fsFiles[requirementsTxt]) {
debug('Found local "requirements.txt"');
const requirementsTxtPath = fsFiles[requirementsTxt].fsPath;
await installRequirementsFile({
filePath: requirementsTxtPath,
workPath,
meta,
});
} else if (fsFiles['requirements.txt']) {
debug('Found global "requirements.txt"');
const requirementsTxtPath = fsFiles['requirements.txt'].fsPath;
await installRequirementsFile({
filePath: requirementsTxtPath,
workPath,
meta,
});
}
const originalPyPath = join(__dirname, '..', 'now_init.py');
const originalNowHandlerPyContents = await readFile(originalPyPath, 'utf8');
// will be used on `from $here import handler`
// for example, `from api.users import handler`
debug('Entrypoint is', entrypoint);
const userHandlerFilePath = entrypoint
.replace(/\//g, '.')
.replace(/\.py$/, '');
public async extract(url: string, files: { [p: string]: ExtractorFile }): Promise {
const dependencies: Array = [];
const contents = files["requirements.txt"].raw();
const lines = contents.split("\n");
lines.forEach((line) => {
const commentIndex = line.indexOf("#");
if (commentIndex > -1) {
line = line.substring(0, commentIndex);
}
line = line.trim()
if (!line || line[0] === "-") {
return
}
let l = line.length;
for (const operator of operators) {
dirsum.digest(dir, 'sha1', function(err, hashes) {
var requirementsHash = undefined
var totalHash = ""
if (hashes && hashes["files"] != undefined) {
requirementsHash = hashes["files"]["requirements.txt"]
if(requirementsHash == undefined) {
requirementsHash = hashes["files"]["package.json"]
}
totalHash = hashes.hash
}
deferred.resolve({
requirements: requirementsHash,
total: totalHash
})
})