New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

glcl

Package Overview
Dependencies
Maintainers
0
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glcl - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

41

dist/clean-files.js
import { parseArgs } from "node:util";
import { searchAndDeleteFileGlobs } from "./searchAndDeleteFileGlobs";
const { values: { dotLocal }, } = parseArgs({
const { values: { dotLocal, file }, } = parseArgs({
args: Bun.argv,

@@ -10,2 +10,7 @@ options: {

},
file: {
type: "string",
short: "f",
multiple: true,
},
},

@@ -15,11 +20,27 @@ strict: true,

});
const fullCleanFileListFile = Bun.file("full-clean-file-list");
const fullCleanFileListText = await fullCleanFileListFile.text();
const filesToDelete = fullCleanFileListText
.split("\n")
.map((line) => line.trim())
.filter((line) => line.length > 0);
if (dotLocal) {
await searchAndDeleteFileGlobs(["**/.local", "**/*.local"]);
let fileNames = [];
if (file) {
fileNames = file;
}
await searchAndDeleteFileGlobs(filesToDelete);
else {
fileNames = ["glob-list.clean"];
}
for (const fileName of fileNames) {
await cleanFiles(fileName);
}
async function cleanFiles(fileName) {
console.log(`Cleaning files at glob patterns from "${fileName}"`);
const fullCleanFileListFile = Bun.file(fileName);
if (!(await fullCleanFileListFile.exists())) {
throw new Error(`glcl: Glob list file not found: "${fileName}"`);
}
const fullCleanFileListText = await fullCleanFileListFile.text();
const filesToDelete = fullCleanFileListText
.split("\n")
.map((line) => line.trim())
.filter((line) => line.length > 0);
if (dotLocal) {
await searchAndDeleteFileGlobs(["**/.local", "**/*.local"]);
}
await searchAndDeleteFileGlobs(filesToDelete);
}
{
"name": "glcl",
"version": "0.0.3",
"version": "0.0.4",
"description": "Cleans your repo via looking at a list of glob patterns in the root",

@@ -8,3 +8,4 @@ "module": "dist/index.js",

"scripts": {
"build": "tsc"
"build": "tsc",
"prepublish": "bun run build"
},

@@ -11,0 +12,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc