Skip to content

Commit 3ee0c4d

Browse files
committed
Don't automatically delete requirements & add manual commands
1 parent 71c87c3 commit 3ee0c4d

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

index.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,38 @@ class ServerlessPythonRequirements {
7070
this.serverless = serverless;
7171
this.options = options;
7272

73+
this.commands = {
74+
'requirements': {
75+
commands: {
76+
'clean': {
77+
usage: 'Remove .requirements and requirements.py',
78+
lifecycleEvents: [
79+
'clean',
80+
],
81+
},
82+
},
83+
commands: {
84+
'install': {
85+
usage: 'install requirements manually',
86+
lifecycleEvents: [
87+
'install',
88+
],
89+
},
90+
},
91+
},
92+
};
93+
7394
this.hooks = {
7495
'before:deploy:createDeploymentArtifacts': () => BbPromise.bind(this)
7596
.then(this.packVendorHelper)
7697
.then(this.packRequirements),
7798

78-
'after:deploy:createDeploymentArtifacts': () => BbPromise.bind(this)
79-
.then(this.cleanup),
99+
'requirements:install:install': () => BbPromise.bind(this)
100+
.then(this.packVendorHelper)
101+
.then(this.packRequirements),
102+
103+
'requirements:clean:clean': () => BbPromise.bind(this)
104+
.then(this.cleanup)
80105
};
81106
}
82107
}

0 commit comments

Comments
 (0)