Skip to content

Commit fa840af

Browse files
committed
feat: add targetFileName option
Closes #12
1 parent c6796a4 commit fa840af

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/classes/Deboa.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ class Deboa implements IDeboa {
112112
/** See {@link IDeboa.targetDir} */
113113
targetDir: IDeboa['targetDir'] = null
114114

115+
/** See {@link IDeboa.targetFileName} */
116+
targetFileName: IDeboa['targetFileName'] = null
117+
115118
readonly #appFolderDestination: string = null
116119

117120
readonly #controlFolderDestination: string = null
@@ -179,7 +182,9 @@ class Deboa implements IDeboa {
179182

180183
this.#outputFile = path.join(
181184
this.targetDir,
182-
`${packageName}_${version}_${architecture}.deb`,
185+
`${
186+
options.targetFileName || `${packageName}_${version}_${architecture}`
187+
}.deb`,
183188
)
184189

185190
this.#controlFolderDestination = path.join(this.#tempDir, 'control')
@@ -211,7 +216,7 @@ class Deboa implements IDeboa {
211216
} = options as IDeboa
212217

213218
if (!packageName) {
214-
throw new Error('The controlFileOptions.`packageName` field is mandatory')
219+
throw new Error('The `controlFileOptions.packageName` field is mandatory')
215220
}
216221

217222
if (!version) {

src/types/IDeboa.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,10 @@ export interface IDeboa {
143143
* **This field is mandatory.**
144144
*/
145145
targetDir: string
146+
147+
/**
148+
* Filename without the `.deb` extension. Defaults to
149+
* `${packageName}_${version}_${architecture}`.
150+
*/
151+
targetFileName?: string
146152
}

0 commit comments

Comments
 (0)