Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed May 12, 2023
1 parent 72274d4 commit e81a37a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/appthreat/cpggen" \
org.opencontainers.image.url="https://github.com/appthreat/cpggen" \
org.opencontainers.image.version="1.1.2" \
org.opencontainers.image.version="1.1.3" \
org.opencontainers.image.vendor="AppThreat" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="cpggen" \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-alma8
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/appthreat/cpggen" \
org.opencontainers.image.url="https://github.com/appthreat/cpggen" \
org.opencontainers.image.version="1.1.2" \
org.opencontainers.image.version="1.1.3" \
org.opencontainers.image.vendor="AppThreat" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="cpggen" \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-oss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LABEL maintainer="appthreat" \
org.opencontainers.image.authors="Team AppThreat <[email protected]>" \
org.opencontainers.image.source="https://github.com/appthreat/cpggen" \
org.opencontainers.image.url="https://github.com/appthreat/cpggen" \
org.opencontainers.image.version="1.1.2" \
org.opencontainers.image.version="1.1.3" \
org.opencontainers.image.vendor="AppThreat" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="cpggen" \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ Download the executable binary for your operating system from the [releases page
- cdxgen with Node.js 18 - Generates SBoM

```bash
curl -LO https://github.com/AppThreat/cpggen/releases/download/v1.1.2/cpggen-linux-amd64
curl -LO https://github.com/AppThreat/cpggen/releases/download/v1.1.3/cpggen-linux-amd64
chmod +x cpggen-linux-amd64
./cpggen-linux-amd64 --help
```

On Windows,

```powershell
curl -LO https://github.com/appthreat/cpggen/releases/download/v1.1.2/cpggen.exe
curl -LO https://github.com/appthreat/cpggen/releases/download/v1.1.3/cpggen.exe
.\cpggen.exe --help
```

Expand Down
18 changes: 13 additions & 5 deletions cpggen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ async def generate_cpg():
src = ""
languages = ""
cpg_out_dir = None
export_out_dir = None
is_temp_dir = False
auto_build = True
skip_sbom = True
Expand Down Expand Up @@ -243,15 +244,19 @@ async def generate_cpg():
src.startswith("http") or src.startswith("git://") or src.startswith("pkg:")
):
url = src
if url.startswith("http") or url.startswith("git://") or url.startswith("pkg:"):
if url:
clone_dir = tempfile.mkdtemp(prefix="cpggen")
if src.startswith("pkg:"):
download_file = utils.download_package(src, clone_dir)
if url.startswith("pkg:"):
download_file = utils.download_package(url, clone_dir)
if download_file and os.path.exists(download_file):
src = clone_dir
else:
src = utils.clone_repo(url, clone_dir)
is_temp_dir = True
if not cpg_out_dir:
cpg_out_dir = tempfile.mkdtemp(prefix="cpggen_cpg_out")
if not export_out_dir:
export_out_dir = tempfile.mkdtemp(prefix="cpggen_export_out")
if cpg_out_dir and not os.path.exists(cpg_out_dir):
os.makedirs(cpg_out_dir, exist_ok=True)
if not languages or languages == "autodetect":
Expand Down Expand Up @@ -483,7 +488,11 @@ def main():
src = args.src
cpg_out_dir = args.cpg_out_dir
export_out_dir = args.export_out_dir
if not src.startswith("http") and not src.startswith("git://"):
if (
not src.startswith("http")
and not src.startswith("git://")
and not src.startswith("pkg:")
):
src = str(PurePath(args.src))
if not cpg_out_dir and src:
if os.path.isfile(src):
Expand Down Expand Up @@ -544,7 +553,6 @@ def main():
languages = languages.split(",")
if cpg_out_dir and not os.path.exists(cpg_out_dir):
os.makedirs(cpg_out_dir, exist_ok=True)

cpg(
src,
cpg_out_dir,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cpggen"
version = "1.1.2"
version = "1.1.3"
description = "Generate CPG for multiple languages for use with joern"
authors = ["Team AppThreat <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit e81a37a

Please sign in to comment.